note 52237 added to features.commandline
| From: | rh at hdesigndotdemondotcodotuk | Date: | Mon, 25 Apr 2005 20:28:33 +0000 |
| Subject: | note 52237 added to features.commandline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88534@lists.php.net to get a copy of this message | ||
In a bid to save time out of lives when calling up php from the Command Line on Mac OS X.
I just wasted hours on this. Having written a routine which used the MCRYPT library, and tested it
via a browser, I then set up a crontab to run the script from the command line every hour (to do
automated backups from mysql using mysqldump, encrypt them using mcrypt, then email them and ftp
them off to remote locations).
Everything worked fine from the browser, but failed every time from the cron task with "Call to
undefined function: mcrypt [whatever]".
Only after much searching do I realise that the CGI and CLI versions are differently compiled, and
have different modules attached (I'm using the entropy.ch install for Mac OS-X, php v4.3.2 and
mysql v4.0.18).
I still can not find a way to resolve the problem, so I have decided instead to remove the script
from the SSL side of the server, and run it using a crontab with CURL to localhost or 127.0.0.1 in
order that it will run through Apache's php module.
Just thought this might help some other people tearing their hair out. If anyone knows a quick fix
to add the mcrypt module onto the CLI php without any tricky re-installing, it'd be really
helpful.
Meantime the workaround does the job, not as neatly though.
----
Manual Page -- http://www.php.net/manual/en/features.commandline.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52237
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52237&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52237&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52237&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52237&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52237&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52237&report=yes
Search -- http://master.php.net/manage/user-notes.php