Find the answer to your Linux question:
Results 1 to 7 of 7
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    PHP files open blank page on browser

    Hello to all,

    I recently installed Apache, MySQL and PHP on Centos 5, and it seems to be installed, but then I go to the folder .../www/html and I create the usual php test file to see if is installed correctly or not.

    When I open the browser and write localhost it display the apache server I assume that apache is well installed, but when I try to open the test.php file of the html folder on the browser..... localhost/test.php it display a blank page on the error, just a blank page, I read somewhere on the web that I have to change the permissions to the folder, I tried with the chmod 777, 755 to the html folder and it stills shows a blank page when I open the file, then I tried with the permission chmod 644 and then it shows an error like Apache won't have the permission to display the file.

    I can't make php to work fine in the server...what can I do?

    thanks for your attention and responses


    Andres Camino

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    NH, USA
    PHP files and their folders must all have execute permission bit set. You say you installed them, but did you configure apache to use the php plugin? You need to restart the httpd service after changing apache configuration.

  3. #3
    Hello coopstah13

    Thanks for your response, I've restarted the httpd service but I still have teh same you have any idea why this is happening?

    Thanks for your help

  4. $spacer_open
  5. #4
    I could fix the problem...but is really weird...because i had to write the change mode in the terminal for each php file like this:

    # chmod 777 /var/www/html/test.php

    and after that the file is shown in the browser when i hit there any way to avoid to write that line for EACH php file I have in that folder and instead write a command like that for the whole folder? ... I tried
    # chmod 777 /var/www/html

    but no luck for all the files...i have to specify the file in order to watch it on the browser

    any suggestions??

    thanks for the responses

  6. #5
    You may wanna try:
    chmod 777 /var/www/html/
    chmod 777 /var/www/html/*
    chmod -R 777 /var/www/html

    if I remember right ...

  7. #6
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Either at home or at work or down the pub
    It's a bad idea to give anything open to the web 777 permissions unless it is really ok for it to be written to.

    I think it is as simple as making sure the apache user (I think it is apache in centos) has read and execute permissions. Try the following

    1. Reset the permissions to 755
    2. chown apache: test.php

    As I say it might not be apache but that's who it is on RHEL
    Should you be sitting wondering,
    Which Batman is the best,
    There's only one true answer my friend,
    It's Adam Bloody West!

    The Fifth Continent

  8. #7
    Thank you very much for your assistance..

    I tried with this line tks to zombykillah
    chmod 755 /var/www/html/* (tks elija for that)

    Is it usual to give permissions to the php files when you just install Apache and PHP??

Posting Permissions

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