By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,116 Members | 1,509 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,116 IT Pros & Developers. It's quick & easy.

script executes differently when triggered remotely

P: n/a
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.

Greetings ..

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

May 15 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On May 15, 3:28 pm, Paul <paul.margul...@gmail.comwrote:
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.

Greetings ..

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
Maybe you rely on environment variables? Just an idea...

May 15 '07 #2

P: n/a
Paul wrote:
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.

Greetings ..

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
Or maybe a permissions problem?

Try enabling all errors and logging them to a php.log file. See if you
get anything to help you debug it.

Additionally, try writing messages at crucial points in your script to
an external file, including critical variables which might affect execution.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 15 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.