I have a ubuntu Dapper LAMP server up and running a ticketing system at my company. The system is oneorzero, I have the system running perfectly on the http side of things. The site works, the tickets can be created from the web interface, it emails notifications via postfix to the ticket managers and what not.
The problem comes in when tickets are emailed to the system. I have set up a job in crontab to check for emails for the system. When it sees a message it will grab the message but it will not interact with mysql. I get the following error.
Fatal error: Call to undefined function mysqli_connect() in /var/www/common/mysql5.class.php on line 51
I had this problem initially with the web end but I uncommented this extension in the php.ini file in the apache2 directory which smoothed everything over.
I tried adding these extensions, mysql.so and mysqli.so to the php.ini file found in the cli directory but it is not working, I made sure the path to the extensions were corret in the /cli/php.ini file, but when i runthe job I get this error:
PHP Warning: PHP Startup: Unable to load dynamic library './usr/lib/php5/ext/mysqli.so' - ./usr/lib/php5/ext/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library './usr/lib/php5/ext/mysql.so' - ./usr/lib/php5/ext/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
Could not open input file: phpinfo
What am I missing here? I have been trying to work through this problem for 4 days now and I am hardly gaining ground. I am happy that I discovered that the terminal (cli) is working off of a different php.ini file then apache is but it seems not to be working.
I installed the Lamp server from a dapper server install disc and I am positive that both extension, mysql.so and mysqli.so exist and that the paths to them in the /etc/php5/cli/php.ini file is correct.
Please HELP!!!!!!
PHP CLI problem
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
What is your extensions directory set to in php.ini? Do these files exists:
Code: Select all
./usr/lib/php5/ext/mysqli.so
./usr/lib/php5/ext/mysql.soThanks for the quick reply, I feel like a heel wasting the forums time now. When you asked what php.ini was pointing to for the extensions directory, i verified by looking at the files. the paths were totally correct, EXCEPT that in the cli php.ini I had the path in there as ./usr/lib/php5/ext/ I looked at that file a thousand times and did NOT see the period prefixing the path. I removed the period and all is well in PHP land.
Again I apologize for my ignorance!
Again I apologize for my ignorance!
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA