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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am having some problems getting php and mysql to work together. I wan't to run phpmyadmin so I can access my mysql remotely from the web without having to install a application. However I am having some frustrating problems getting php to work with mysql. The main problem right now is that phpmyadmin can't find the mysql.so file so it can't connect to the DB. There is a old version of php installed on the server that I am working with and it doesn't seem to be configured for mysql (the older version is php 4.2.2) anyways the configuration file for it is nowhere to be found so I can't reconfigure or reinstall it. I also tried installing php 4.3.4 before I knew that php 4.2.2 was installed. How can I get the mysql.so file?
I created phpinfo file to see what was going on and noticed that it says that mysql is a supported database and that the with-mysql option was used when php was configured. However where it lists the files in the extension directory there is no mysql.so file. I did a updatedb command that a locate mysql.so command and came up with nothing.
There is a really nice how-to on getting Apache, MySQL and PHP to work together at the Snort documentation site. Just ignore the bits about Snort and Acid (although if you have MySQL and PHP working, Snort and Acid aren't that much extra work).
Well all I really need is the mysql.so file. I can't find it anywhere on the server.
I noticed that php-mysql installs the mysql.so file but every package for it I find is a rpm and I keep getting failed dependencies errors when I try to install it through the rpm so does anyone know where I can get a tarball version of it?
After doing a bit of googling around, it looks to me like PHP wasn't compiled correctly. If you read through the Snort document I pointed you towards, you'll see that PHP needs to be configured at compile time to point to the MySQL directory. The flag would look something like --with-mysql=/path/to/mysql.
Now from your phpinfo dump:
Quote:
--with-mysql=shared,/usr
It looks to me like PHP is looking in the /usr directory for MySQL. If that isn't where MySQL actually lives, that could explain why phpmyadmin isn't finding the right files.
If I were in your shoes I would compile PHP from scratch. The Snort document points to sites that should solve the dependency problems.
It really sounds to me like you need to start from the beginning. Unless you've specifically set up PHP, MySQL and Apache to work together, they may not. My opinion is that there is no quick fix to your problem. If anyone else has a different opinion, I'd love to hear it.
Well I had them working together but I am not the only person who works on the server and something was changed and after that it wasn't working anymore. Everything should be set to work together. I could reinstall mysql and php I suppose but I don't think anything is wrong with mysql...
I reconfigured mysql with ./configure --with-mysql=/usr/lib/mysql
I got these messages
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find MySQL header files under /usr/libmysql
./configure ---with-mysql=/usr/local/mysql
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
./configure ---with-mysql=/usr/bin/
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find MySQL header files under /usr/bin
Now I am guessing that not finding the socket is a bad thing. My mysql.sock file is located in /tmp
The shared libraries for mysql are located in /usr/lib/ I compiled mysql at /usr/local/mysql and the client files are located in /usr/bin
Hm. Are you the admin or is that someone else? I guess at this point I would try to pursue finding out what was changed to break the PHP-MySQL connection. That could determine the future course of action. Also, if someone else is the admin, you're probably going to need their permission to really mess with the guts. If you're really lucky, you could even make it their problem.......
You're probably right in that MySQL doesn't need to be re-installed, but I'm still guessing that PHP might be. It might be worth looking in your php.ini file and seeing if anything there jumps out as misconfigured, but from the googling I did it sounds like PHP may need to be re-compiled.
I am not the admin on it. I am pretty sure the the break was due to this older version 4.2.2. I had a newer version running with apache and than all the sudden it started using this 4.2.2 version that was compiled a year ago and isn't configured to work with mysql or doesn't seem to be anyways. I would uninstall it but I haven't reached the admin yet to find out if he is using it. I can tell that wasn't mean't to be using apache though. The directory it's pointing to for the apxs file no longer has a apxs file there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.