FedoraForum.org - Fedora Support Forums and Community
Results 1 to 7 of 7
  1. #1
    oista Guest

    apache does not run php scripts

    Hi,
    I'm new to Fedora and I've searched for an answer but can't find one. Sure this has been asked before somewhere but here goes.
    Fedora 8. HTTPD is running. PHP modules are installed with apache. PHP files display as text showing the php code instead of running as scripts.
    The php scripts are in the directory var/www/html
    How can I get apache to run the php scripts?
    Last edited by oista; 14th January 2008 at 01:48 PM. Reason: speling mistake

  2. #2
    Join Date
    Jan 2005
    Posts
    5,057
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AddType application/x-httpd-php .php

    Add this to the addtpye lines in the conf file.


    Put this test script in a myphpenv.php in www/cgi-bin (I think) # Without the #'s
    #<?php
    #phpinfo();
    #?>

    SJ
    Do the Math

  3. #3
    oista Guest
    Quote Originally Posted by SlowJet
    AddType application/x-httpd-php .php

    Add this to the addtpye lines in the conf file.


    Put this test script in a myphpenv.php in www/cgi-bin (I think) # Without the #'s
    #<?php
    #phpinfo();
    #?>

    SJ
    Thanks. I added the line to the httpd.conf and restarted httpd...
    Still nothing. Does not procces php files but asks how I would like to open them

    I noticed that despite PHP being installed with my apache server, there is no reference to php in the httpd.conf file (except the line that I just added).

    Any ideas folks?

  4. #4
    Join Date
    Aug 2007
    Location
    Reno NV.
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put this test script in a myphpenv.php in www/cgi-bin (I think) # Without the #'s
    #<?php
    #phpinfo();
    #?>

    By putting that line in a text file and placing it in the ,, /var/www/html/ ,, file and then pointing your browser to the localhost/php.info ,, file that you just created should show up,,, If not then php scripting isn't active,,, If you still experience problems after that then,,, perhaps this link will give you more info on how to get php ,,, or whether php is working ,,

    http://dan.drydog.com/apache2php.html


    Hope all works out for you,,

  5. #5
    oista Guest
    Thanks for that advise. It proves that php is not active.
    Is it possible, with Fedora 8, to install apache with php so that php runs withous having to search for help on other sites and then manually edit configuration files?

  6. #6
    lmo Guest
    Without configuring one single thing, I got php working on F7.

    I had selected apache to install during the install, but forgot php.
    I just now installed php
    Code:
    yum install php
    Then I made a quick test php script
    Code:
    su -
    cd /var/www/html
    echo -e "<?php\nphpinfo();\n?>" > helloworld.php
    Then I started apache for the first time
    Code:
    /etc/init.d/httpd restart
    Then I put this in the browser's adress bar
    Code:
    127.0.0.1/helloworld.php
    It printed the php info page.

  7. #7
    oista Guest
    Quote Originally Posted by lmo
    Without configuring one single thing, I got php working on F7.
    .... Then I put this in the browser's adress bar
    Code:
    127.0.0.1/helloworld.php
    It printed the php info page.
    Eureka!! It's the way that you put it in the address bar that works.

Similar Threads

  1. yum and scripts
    By assalane in forum Using Fedora
    Replies: 3
    Last Post: 5th March 2009, 12:48 PM
  2. Help running cgi/pl scripts in Apache
    By coffee412 in forum Servers & Networking
    Replies: 1
    Last Post: 22nd November 2008, 02:27 AM
  3. Replies: 12
    Last Post: 19th November 2008, 05:56 AM
  4. unable to connect to network from within apache cgi scripts
    By mtntrx in forum Servers & Networking
    Replies: 3
    Last Post: 6th October 2007, 04:04 AM
  5. Replies: 2
    Last Post: 17th November 2005, 12:36 PM

Tags for this Thread

Posting Permissions

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