I'm not positive that my problem is with the Linux end of this, but I'm pretty sure the php end is okay, so here goes:
I need to run a php script with includes from a cron job on a remote (hosted) Linux server. The cron job:
triggers ok - it runs a bash script called cron-lynx.sh that resides in the home/warmsafe/event_mgr/admin/sh_scripts folder. The bash script works too - it starts a php file called testcron.php located in home/warmsafe/event_mgr/admin. Testcron.php has an include that points up one level and then back down one level (../includes/mysql_connect.p hp). The first line in testcron.php (before <?php) is
which starts php if I'm understanding this correctly. Then, since php is being started from the php directory rather than running through Apache, I can't use the path that is configured in Apache, so I have to set the path on the fly. To do this I've got the command
as the first command inside the <?php section of the file.
The error message is:
I think the problem lies in the placement of the bash script, but I'm not sure if that's in relation to the php file or or to the /bin/sh directory or what? And why doesn't the ini_set statement make that a moot point anyway? My Linux is pretty rusty, so I beg your patience as well as your assistance.
I need to run a php script with includes from a cron job on a remote (hosted) Linux server. The cron job:
Code:
/bin/sh /usr/www/users/warmsafe/event_mgr/admin/sh_scripts/cron-lynx.sh
Code:
#!/usr/local/bin/php
Code:
ini_set("include_path", ".:/usr/lib/php:/usr/local/lib/php:/home/warmsafe/public_html/event_mgr/admin/")
The error message is:
Code:
: not found #!/usr/local/bin/php <br /> <b>Warning</b>: include(pages/mail_function.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in <b>/usr/www/users/warmsafe/event_mgr/admin/testcron.php</b> on line <b>9</b><br /> <br /> <b>Warning</b>: include() [<a href='function.include'>function.include</a>]: Failed opening 'pages/mail_function.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/warmsafe/public_html/event_mgr/admin') in <b>/usr/www/users/warmsafe/event_mgr/admin/testcron.php</b> on line <b>9</b><br /> <br /> <b>Fatal error</b>: Call to undefined function mail_attachment() in <b>/usr/www/users/warmsafe/event_mgr/admin/testcron.php</b> on line <b>17</b><br />
Comment