PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Dec 19, 2018 10:28 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Nov 18, 2014 9:32 am 
Offline
Forum Commoner

Joined: Thu Nov 06, 2014 11:29 am
Posts: 47
Location: Gilbert, Arizona
We set up a new Ubuntu Linux Server, just as a Test Web Server. We noticed that with Apache 1 Server, the files were located previously in /var/www/. However, with Apache2 we find that the fields are to be launched from /var/www/html. So, we put the same files that were in /var/www into /var/www/html. No workie!!!

We cannot connect to the MySQL database, nor can we login, of course. What did we do wrong?

Cecil

_________________
Cecil Champenois


Last edited by cecilchampenois on Tue Nov 18, 2014 11:38 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Tue Nov 18, 2014 9:37 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6424
Location: Montreal, Canada
Sounds like there are a few things going on here. Have you confirmed that both Apache and MySQL server are installed and running? Can you log into MySQL as root?

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Tue Nov 18, 2014 11:41 am 
Offline
Forum Commoner

Joined: Thu Nov 06, 2014 11:29 am
Posts: 47
Location: Gilbert, Arizona
Yes, both Apache2 and MYSQL are running.

_________________
Cecil Champenois


Top
 Profile  
 
PostPosted: Wed Nov 19, 2014 9:34 am 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5978
Location: Odessa, Ukraine
Does MySQL have tables and data in those tables required by your application?


Top
 Profile  
 
PostPosted: Fri Dec 12, 2014 8:23 am 
Offline
Forum Commoner

Joined: Thu Nov 06, 2014 11:29 am
Posts: 47
Location: Gilbert, Arizona
Weirdan wrote:
Does MySQL have tables and data in those tables required by your application?


Yes, MySQL does have a database and tables ready to go. The difference between Apache 1 and 2 is that Apache 2 now expects that you will place your PHP files into the HTML foldfer rather directly into the www folder.

Before with Apache 1: /var/www/

Now with Apache 2: /var/www/html/

I also corrected paths for any code that pointed off to former places to the correct places.

_________________
Cecil Champenois


Top
 Profile  
 
PostPosted: Fri Dec 12, 2014 8:30 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6424
Location: Montreal, Canada
Ubuntu 10.04 shipped with Apache 2.2, not 1.x. Regardless, that wouldn't explain why you're unable to login to MySQL. One has nothing to do with the other. So, MySQL notwithstanding, do your PHP and Apache installs appear to be working properly (ie. index.php with phpinfo() in it displays correctly)? Are you able to login to MySQL via the CLI? That would at least narrow down where the problem lies.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Fri Dec 12, 2014 4:39 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13585
Location: New York, NY, US
cecilchampenois wrote:
Yes, MySQL does have a database and tables ready to go. The difference between Apache 1 and 2 is that Apache 2 now expects that you will place your PHP files into the HTML foldfer rather directly into the www folder.

Before with Apache 1: /var/www/

Now with Apache 2: /var/www/html/

I also corrected paths for any code that pointed off to former places to the correct places.

Still sounds like you need to narrow down the actual problem.

- It sounds like you can login to MySQL from the command line -- correct?

- In the new database, have you created the user that you PHP application uses to connect to the database? Does it have the correct privileges?

- Can you actually run a PHP script? I can't tell from your responses if PHP actually works?

- From PHP, can you connect to MySQL -- even with a test script? If not it may be the user or privileges mentioned above. Also, sometimes you need to connect to MySQL at 127.0.0.1 vs localhost depending on the server configuration.

_________________
(#10850)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group