Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
(Resolved) Apache Mysql Php: mysql with php doesn't work
Hola
I compiled and installed the latest version of apache, mysql and php just the other day. I have just gotten around to testing to make sure that all 3 work with each other and I did this by creating:
Code:
<html>
<head>
<title></title>
</head>
<body>
<?php
$connection = mysql_connect("localhost","root","")
or die("sorry - unable to connect to MySQL");
echo("Congrats - it's working");
?>
</body>
</html>
Now if all was working fine I should have seen the "Congrats" message when viewing the file saved as php on apache. I know that the apache is working and that php is working... however when trying to view that partuicular file I get an error message:
Quote:
Warning: Unknown(/usr/local/apache2/htdocs/index.php): failed to open stream: Permission denied in Unknown on line 0
Warning: (null)(): Failed opening '/usr/local/apache2/htdocs/index.php' for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0
Now unfortunately, I'm a php / mysql "know nothing" at the moment (soon to change hopefully) but I'm not sure where to go from this error. I checked the php info file and something strange I noticed is the MySQL section:
Quote:
Client API version 3.23.49
Now I know 100% that I compiled in the latest mysql which happens to be 4.0.17: so could this be my problem?
Any help really appreciated and merry christmas too
Last edited by breakerfall; 12-27-2003 at 09:00 PM.
I had a problem similar to this. Did you compile php from source or use the rpm ? When you compile it from source, you have to tell it to use mysql so go ./configure --help | grep SQL and you should see something relevant.
I had already done this as soon as I had installed and compiled mysql. I can actually access the mysql prompt now doing /usr/local/mysq/bin/mysql -u root -p, it's just that php doesn't seem to be interacting with it. That combined with the phpinfo file showing me that the mysql version is 3.23 which is way out. :|
I guess I'm going to have to remove apache php and mysql and start over... thanks anyway
The problem has been resolved. When I compiled php I just the switch "--with-mysql" when what I really should have done was "--with-mysql=/usr/local/mysql".. the documentation didn't make me aware of this. I noticed after deciding to re-compile php again and my console window was larger and I saw the very top bit of the end of configure message which mentioned what switch to use if I had installed mysql and didn't want to use phps own builtin mysql.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.