Php script runs differently when triggered remotely

This is a discussion on Php script runs differently when triggered remotely within the PHP General forums, part of the PHP Programming Forums category; Greetings, I have a PHP script that is triggered by a .forward file when incoming email arrives. When triggered, the ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-15-2007
Paul
 
Posts: n/a
Default Php script runs differently when triggered remotely

Greetings,

I have a PHP script that is triggered by a .forward file when incoming
email arrives. When triggered, the script retrieves the email using
the php imap functions, processes the email, and then deletes it and
empties the inbox before exiting. This setup worked fine whether the
script was triggered by an incoming email or manually via shell.

Recently, however, I noticed that emails were not being properly
deleted before exit when the script was triggered automatically. But
when I ran the script manually it functioned as expected. I did some
error checking and discovered that certain "points" in the script were
not being reached (seemingly) when the execution was a result of
the .forward. I can't find any errors in the code that would explain
this, however.

Does anyone have any ideas of why execution of a php script might be
different when I run it via shell vs when it is triggered by
a .forward file? Could any changes have been made to my server that
would explain the recent occurrence of this strange difference?

Thanks for any insights you have,
Paul

Reply With Quote
  #2 (permalink)  
Old 05-16-2007
Mike P2
 
Posts: n/a
Default Re: Php script runs differently when triggered remotely

On May 15, 12:30 am, Paul <paul.margul...@gmail.com> wrote:
> Greetings,
>
> I have a PHP script that is triggered by a .forward file when incoming
> email arrives. When triggered, the script retrieves the email using
> the php imap functions, processes the email, and then deletes it and
> empties the inbox before exiting. This setup worked fine whether the
> script was triggered by an incoming email or manually via shell.
>
> Recently, however, I noticed that emails were not being properly
> deleted before exit when the script was triggered automatically. But
> when I ran the script manually it functioned as expected. I did some
> error checking and discovered that certain "points" in the script were
> not being reached (seemingly) when the execution was a result of
> the .forward. I can't find any errors in the code that would explain
> this, however.
>
> Does anyone have any ideas of why execution of a php script might be
> different when I run it via shell vs when it is triggered by
> a .forward file? Could any changes have been made to my server that
> would explain the recent occurrence of this strange difference?
>
> Thanks for any insights you have,
> Paul


It is possible that in one case the script is run through CGI/CLI and
the other time it is run as a server module. Things that could be
different between the two ways the script is run include file
permissions, PHP version, installed PHP extensions, PHP.ini in use,
and some other things.

-Mike PII

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:26 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0