Results 1 to 2 of 2
Hello, I am very new to MySQL so forgive me. Currently I am attempting to successfully upload this script to Apache:
Code:
<?php
mysql_connect("localhost", "root", "mypass") or die(mysql_error());
echo "Connected ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-05-2012 #1Just Joined!
- Join Date
- Jun 2012
- Posts
- 37
Can't seem to upload script to Apache
Hello, I am very new to MySQL so forgive me. Currently I am attempting to successfully upload this script to Apache:
So that when I view the .php page it displays "Connected to MySQL." Instead what it displays is nothing at all. I am running linux and I have all my .php files in /srv/http. I can see them in localhost but when I click on the appropriate file with the above code it doesn't work. Is there a problem with my syntax or am I doing something else wrong? I am following this tutorial:Code:<?php mysql_connect("localhost", "root", "mypass") or die(mysql_error()); echo "Connected to MySQL<br />"; ?>
MySQL Tutorial - Connect
But it doesn't seem to have a very good explanation of how to upload the .php to my webserver.
I should also mention that I have other php scripts on my localhost that I can see fine. It's just the script with mysql in it that doesn't seem to work.
- 11-06-2012 #2Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,685
Hi,
Does it work from the command line? E.g.:
Is there anything in the Apache log files?Code:php mysql.php
Code:/var/log/apache2/


Reply With Quote
