Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Servers > Setting up PHP and MySQL

Forgot Password?
 Servers   Anything server related, Apache, MySQL, Samba, server security, sendmail, exim, etc

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 05-15-2005   #1 (permalink)
Just Joined!
 
Join Date: Dec 2004
Location: localhost
Posts: 56
Setting up PHP and MySQL

I am running Fedora CORE 3 on one computer, and FC2 on another. I finally got some help with enabling apache (httpd actually), so that it works on boot. But now I want to get PHP and MySQL working with it. It looks like PHP is set up with Apache already, because it did this durring installation of the operating system, but it seems like it is a matter of enabling PHP and MySQL.

I get a error in the apache (httpd) error log when a php page with phpinfo() is viewed.

Here is the error I get in the apache log:
Quote:
[client 127.0.0.1] PHP Warning: Unknown(/var/www/html/users/index.php): failed to open stream: Permission denied in Unknown on line 0
[client 127.0.0.1] PHP Warning: (null)(): Failed opening '/var/www/html/users/index.php' for inclusion (include_path='.:/usr/share/pear') in Unknown on line 0
Any help would be nice. Thanks.
version2 is offline  


Reply With Quote
Old 05-15-2005   #2 (permalink)
Linux Engineer
 
jledhead's Avatar
 
Join Date: Oct 2004
Location: North Carolina
Posts: 1,032
Re: Setting up PHP and MySQL

Quote:
Originally Posted by version2
Permission denied
that part looks interesting. does the apache user have access to the users subdirectory?

the easiest thing to test php is to create a phpinfo file in a directory that you already know apache can read, like /var/www/html/

create a file called phpinfo.php and place it inside that dir. the file should only have this code

Code:
<?php
phpinfo();
?>
and then try to hit the page
jledhead is offline   Reply With Quote
Old 05-16-2005   #3 (permalink)
Just Joined!
 
Join Date: Dec 2004
Location: localhost
Posts: 56
Re: Setting up PHP and MySQL

Quote:
Originally Posted by jledhead
Quote:
Originally Posted by version2
Permission denied
that part looks interesting. does the apache user have access to the users subdirectory?

the easiest thing to test php is to create a phpinfo file in a directory that you already know apache can read, like /var/www/html/

create a file called phpinfo.php and place it inside that dir. the file should only have this code

Code:
<?php
phpinfo();
?>
and then try to hit the page
Thats what I thought I did, and that was the error I got: inside the apache error log. I'll try again though.

EDIT:
I get a blank page. Nothing outputted.
This is what is in the error log now:
Quote:
[client 127.0.0.1] PHP Warning: Unknown(/var/www/html/phpinfo.php): failed to open stream: Permission denied in Unknown on line 0
[client 127.0.0.1] PHP Warning: (null)(): Failed opening '/var/www/html/phpinfo.php' for inclusion (include_path='.:/usr/share/pear') in Unknown on line 0
version2 is offline   Reply With Quote
Old 05-16-2005   #4 (permalink)
Linux Newbie
 
Join Date: Sep 2003
Location: St.Charles, Missouri, USA
Posts: 201
Send a message via AIM to gwalters Send a message via MSN to gwalters Send a message via Yahoo to gwalters
Im gonna bet that the apache webroot isnt user writable so you made the file as root. Try
Code:
chmod 777 /var/www/html/phpinfo.php
as root then retry viewing the file.
__________________
Powered by Gentoo
never ever ever use the hardened option in make.conf!
gwalters is offline   Reply With Quote
Old 05-16-2005   #5 (permalink)
Just Joined!
 
Join Date: Apr 2005
Posts: 88
Send a message via MSN to KidCloudWala
PHP Error

Greetings,

Also, Can you check if you have the php-pear rpm installed as well or not?

Regards
KidCloudWala is offline   Reply With Quote
Old 05-17-2005   #6 (permalink)
Just Joined!
 
Join Date: Dec 2004
Location: localhost
Posts: 56
I guess it was a permissions problem. I set it to 777 and it worked.

I'm pretty sure I have pear installed, and PHP works anyway. Now I have to see if MySQL works properly.
version2 is offline   Reply With Quote
Old 05-17-2005   #7 (permalink)
Just Joined!
 
Join Date: Dec 2004
Location: localhost
Posts: 56
I installed Webmin on my Fedora CORE 3 computer. From there, I "started" MySQL so I could use it with PHP. However, I was trying to get Zpanel to work, but I don't know the root mysql password. It does not seem to be my "normal" root password.

(Sorry for the double post.)
version2 is offline   Reply With Quote
Old 05-18-2005   #8 (permalink)
Linux Engineer
 
jledhead's Avatar
 
Join Date: Oct 2004
Location: North Carolina
Posts: 1,032
if I am not mistaken (and its possible I am), mysql installs with a blank root password.

I use phpmyadmin for my sql stuff, seems to be a little better at that then webmin, not to knock webmin, I use that a lot
jledhead is offline   Reply With Quote
Old 05-18-2005   #9 (permalink)
Just Joined!
 
Join Date: Dec 2004
Location: localhost
Posts: 56
Quote:
Originally Posted by jledhead
if I am not mistaken (and its possible I am), mysql installs with a blank root password.

I use phpmyadmin for my sql stuff, seems to be a little better at that then webmin, not to knock webmin, I use that a lot
I don't use webmin for managing MySQL, I just started that service from webmin (then I fixed it so my computer would start MySQL on boot).

The blank password did not work. I've installed ZPanel, the same version before and it worked (actually last time I installed it, I used no root password, but that was on a windows computer).

EDIT: I have downloaded phpmyadmin, and I get an error:
Quote:
Error
MySQL said:
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
This could be caused because of a number of reasons: for example file privilages aren't set properly, or because this version of phpmyadmin may not been tested with my version of MySQL. But until I test to see what the real problem is here, I'd thought I'd post this error anyway just incase it helps anyone.
version2 is offline   Reply With Quote
Old 05-18-2005   #10 (permalink)
Linux Engineer
 
jledhead's Avatar
 
Join Date: Oct 2004
Location: North Carolina
Posts: 1,032
found this in another place
Quote:
To see if mysql is running type this:
$ ps -aux | grep mysqld

You should get some output regarding the running mysqld processes

To set the root password do this from the terminal:

$ /usr/local/mysql/bin/mysql -u root -p
Password: (just hit return)

This should get you into the mysql command line interface.

Now type:
mysql> update user set Password=PASSWORD('your_password_here') where
User = 'root';

mysql> flush privileges

mysql> quit
try that from command and see if you can get anything positive
jledhead is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 05:31 PM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2