Find the answer to your Linux question:
Results 1 to 5 of 5
Hello everyone :P I am trying to setup a webserver.Everything is awesome except one thing I see php files as text when i try to view them with the browser. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! javilin93's Avatar
    Join Date
    Jun 2008
    Location
    Atlanta
    Posts
    36

    help setting up Apache


    Hello everyone :P
    I am trying to setup a webserver.Everything is awesome except one thing I see php files as text when i try to view them with the browser.
    I uncommented the line to enable php,I checked if the module was there,but i still can not see php files.
    I have slackware 12.0,and I am a total noob when it comes to apache.
    How can i fix this???

    Thanks in advance

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,101
    Check to see if you have the following entries. In your httpd.conf file add to Directory Index: index.php Add '.httpd-php .php' to Add Type Application - near bottom of file. Set Document Root to /var/www/htdocs. In /etc/apache there is a 'php.ini' file. need /var/www/htdocs entered for doc_root.

  3. #3
    Just Joined! javilin93's Avatar
    Join Date
    Jun 2008
    Location
    Atlanta
    Posts
    36
    hi
    I check everything and everything was there,but there is a small problem whenever I try to view anything I get a
    Forbidden You don't have permission to access / on this server.
    How can this happen last week it was working fine(except the php files).
    Do you know how to fix this??
    thx in advance

  4. #4
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,101
    If you made any of these changes, you need to re-start apache.
    Did you create the info.php file? If not, open a text editor and type the following in it: <?php phpinfo();?>
    Save it as info.php in your /var/www/htdocs directory and also a copy in your public_html directory in your home directory. Try accessing it in the /var/www/htdocs by opening a browser and entering: http://localhost/info.php
    If that doesn't work (probably won't) open the browser and enter the following:
    http://localhost/~javelin93/info.php (change javelin93 to whatever your actual username is. If this works you should get a lot of information which might help resolve the problem.

    When you added .httpd-php .php to Add Type Application, did you put the period (.) in front and a space between?

    Not sure if this will help. Are you saying that now you are unable to access anything on apache or just not php files?

  5. #5
    Just Joined! javilin93's Avatar
    Join Date
    Jun 2008
    Location
    Atlanta
    Posts
    36
    I restarted apache,but i get the same thing(403 forbidden).
    oh I cannot access anything

Posting Permissions

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