Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    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:
    [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.

  2. #2
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077

    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&#40;&#41;;
    ?>
    and then try to hit the page

  3. #3
    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&#40;&#41;;
    ?>
    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:
    [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

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie
    Join Date
    Sep 2003
    Location
    St.Charles, Missouri, USA
    Posts
    201
    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!

  6. #5
    Just Joined!
    Join Date
    Apr 2005
    Posts
    88

    PHP Error

    Greetings,

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

    Regards

  7. #6
    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.

  8. #7
    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.)

  9. #8
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    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

  10. #9
    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:
    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.

  11. #10
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    found this in another place
    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

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •