Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
i have php installed, my php scrpits online work great
mysql is installed. doesnt work with php though. i tried to run a php script that connects to my mysql database. on my error log it got that the connect command wasn't recognises. meaning mysql and php arent set up to work togethor properly
the php version is 5 and mysql version is 4
what config files and settings do should i look through to double check stuff is set right so that mysql will work wiht php?
I was just about to post this exact same question. I think he means that he gets a
"Fatal error: Call to undefined function: mysql_connect() in /var/www/html/test/index.php" error. I have the exact same problem as I'm useless with Linux. In windows you just uncomment a line in php.ini to include the mysql module. How do you do this in linux (Red Hat enterprise) without recompiling php or apache?
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043
Rep:
That error normally means that you do not have the mysql module loaded for php. Can you post your php config file? Their was a change I had to make on my system to get it running right.
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename.extension
;
; For example:
;
; extension=msql.so
;
; Note that it should be the name of the module only; no directory information
; needs to go here. Specify the location of the extension with the
; extension_dir directive above.
extension=mysql.so
;;;;
; Note: For Red Hat Linux, packaged extension modules are now loaded via
; the ini files in the directory /etc/php.d.
;;;;
You see, mysql.so is included as a module and it does exist in the extension_dir but it still doesnt work
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043
Rep:
Ok, so I think I found it. If you look at line 398 or close to it you will see extension_dir.
This should point to /usr/lib/php/extensions.(This is if you are using slackware.) I am not sure where Ubuntu and other distro's keep these modules. Just one suggestion. I would use myslqi. so your commands would be mysqli_connect(). mysqli has extended functionality.
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043
Rep:
Well a couple of good things came out of this. One we know apache and php are working together. We also
know that php did not load the mysql.so . If you look under mime_magic it goes straight into the o's.
I am currently installing Debian on my Server at the house. Once it completes I may have a look to see
if I can tell of any differences from slackware. By the way What Distro do you have? Also can You post your whole php.ini file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.