Hot answers tagged php-cli
Having only execute permission is fine if it is a binary. Scripts must have read permission so that their interpreter can read them.
When APC is configured with mmap it only uses 1 shm_segment. To remove the warning either comment out or delete the apc.shm_segments line in your .ini file.
You are maybe not using the same php binary in the terminal and in cron, because of a different PATH setting. Enter which php in the terminal and put the full path to the php binary in your cron script.
On debian/ubuntu it's the php5-cli package, but without knowing what OS you're actually using there's no real answer.
In order to get the colour on your console with PHP CLI, php5-posix module has to be installed. With MacPorts the following command does the job: sudo port install php5-posix Enabling colour on the console for the PHP output will hugely improve the readability in Symfony projects for instance.
I had the same problem. Running any command throws this error message PHP Warning: PHP Startup: apc.shm_segments setting ignored in MMAP mode in Unknown on line 0 in my case the setting was in apc.ini under the path /etc/php.d/apc.ini I have updated the line "apc.shm_segments=3" to "apc.shm_segments=1" and it solved the problem.
if you execute the script directly either using the full path or ./test.php with a shebang line it will need to be executable. If you specify the interpreter (ie. php) it's the interpreter that needs to be able to execute code, so in this case it only needs to be able to read the code.
It would seem fairly likely that you've made a mess of your php.ini. Comment out one change at a time until it starts working again, then leave that change commented and uncomment one chang at a time. If it stops working again, then leave that one commented and continue. Once you've got only the known troublemakers commented out, you can then work on ...
Resolved by adding the "noserverino" to the mount parameters
It seems that php5_module is already loaded by yourself and loaded later by the default rhel6 configuration or the configuration on rhel6 is loading the module php5_module... which in itself doesn't matter except for the fact that the configuration you are entering is being overridden by the default rhel6 configuration. Looking at step 11 from Dan's site, ...
Yes, the file needs to be readable for the user you try to run it with. On a side note, the executable bit doesn't need to be set if you call it the way you do (php /path/to/script.php).
Have you installed the extension to where your command line version of PHP expects it to be? Check extension_dir in your /etc/php.ini to see where it expects to find extensions and install the extension there or point it at your lampp PHP extensions directory (assuming it is a compatible version of PHP).
Both php.ini's contains a different extension_dir setting, /etc/php.ini seems to set it to /usr/lib/php/modules and LAMPP sets it to /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626. To make Mailparse work for LAMPP, you need to copy mailparse.so to /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626 and add extension=mailparse.so to ...
It is clear that the CLI PHP SAPI is installed, because you can run it. Most likely the issue is that the configuration script or your CGI is running in a chroot and cannot find it; you need to determine where it expects the CLI to be (you may have to read through the config test script if this isn't documented anywhere), and make it available there in the ...
Only top voted, non community-wiki answers of a minimum length are eligible