MySQL functions not working when PHP script is called from exec()
I have a PHP script I execute in the background from an exec call. Everything works except for the MySQL functions (they don't exist). If I call the script directly from开发者_StackOverflow the browser it works fine. What's happening here? Any ideas?
Thank you for your time
Either your command line php was not compiled with php, or php.ini for your command line php does not have the mysql driver module loaded. You'll need to reconfigure and/or rebuild your php installation.
Probably, php_mysql.so
is not enabled in your main php.ini
but is enabled in an additional ini file added to Apache
with PHPIniDir
.
Compare output of phpinfo()
called from the command line and from a web script. You should see the difference between the ini files and directories used.
精彩评论