Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: apache and .php

  1. #1
    Join Date
    Jan 2005
    Beans
    140
    Distro
    Ubuntu 7.04 Feisty Fawn

    Unhappy apache and .php

    I have this problem i cant make my firefox or mozilla executes a .php creating a local website all the time try to download it and open it as a text file, ive been googling and asking in the irc channels but noone seems to be able to solve, should be a problem with httpd.conf, which i have 2 one in /etc/apache-perl and one in etc/apache2, should be this last one to modify by adding in the <ifModule mod_dir.c>
    this:

    AddType application/x-httpd-php .php .php3 .php4 .phtml
    AddType application/x-httpd-php-source .phps

    the point is there is not such section this is paste of my whole httpd.conf file in /etc/apache2

    # This is here for backwards compatability reasons and to support
    # installing 3rd party modules directly via apxs2, rather than
    # through the /etc/apache2/mods-{available,enabled} mechanism.
    #
    #LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so

    as u can see is nothing but a huge comment

    please any idea how to help me

    Thanks in advance


  2. #2
    Join Date
    Apr 2005
    Location
    Denmark
    Beans
    5

    Re: apache and .php

    Where do you place the php file you want to parse and view in your browser?

    The files must be under your document root - the default is /var/www. Other directories can be added by creating virtual hosts in /etc/apache2/sites-available. Otherwise php wont parse the files.

    The Apache config file is /etc/apache2/apache2.conf

    Check that file for these lines:
    Include /etc/apache2/mods-enabled/*.load
    Include /etc/apache2/mods-enabled/*.conf

    You should also have a file named php4.conf in /etc/apache2/mods-enabled containing these lines:
    <IfModule mod_php4.c>
    AddType application/x-httpd-php .php .phtml .php3
    AddType application/x-httpd-php-source .phps
    </IfModule>

  3. #3
    Join Date
    Jan 2005
    Beans
    140
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: apache and .php

    thx rostved

    Ive been checking and I lack this php4.conf file, shoud I create a blank one and add the lines u gave me?

  4. #4
    Join Date
    Apr 2005
    Location
    Denmark
    Beans
    5

    Re: apache and .php

    You're welcome

    I've just noticed that /etc/apache2/mods-enabled/php4.conf is just a link to the actual file in /etc/apache2/mods-available/

    But if you lack the file, you've probably not installed the Apache PHP module, which is the package named libapache2-mod-php4. Installing this should setup PHP as a module for Apache. Just apt-get for it.

    Maybe you should take a look at this thread:
    http://ubuntuforums.org/archive/index.php/t-17875.html

    I hope this is helpful

  5. #5
    Join Date
    Jan 2005
    Beans
    140
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: apache and .php

    I already have that package in my system, I was reading that link but is for apache Im using apache 2

  6. #6
    Join Date
    Feb 2005
    Beans
    160

    Re: apache and .php

    What folder are you saving your php file in?

    What do you get when you run this command?
    Code:
    ls /etc/apache2/mods-enabled/

  7. #7
    Join Date
    Jan 2005
    Beans
    140
    Distro
    Ubuntu 7.04 Feisty Fawn

    Talking Re: apache and .php

    I was saving in /var/www but I solved it at last doing this

    /etc/apache2/mods-enabled # ln -s /etc/apache2/mods-available/php4.conf /etc/apache2/mods-enabled/php4.conf


    etc/apache2/mods-enabled # ln -s /etc/apache2/mods-available/php4.load /etc/apache2/mods-enabled/php4.load

    /etc/apache2/mods-enabled # /etc/init.d/apache2 restart * Forcing reload of web server (Apache2)... [ ok ]

    xD thx very much to all of you were helping me xD

  8. #8
    Join Date
    Jan 2005
    Beans
    48
    Distro
    Ubuntu Breezy 5.10

    Re: apache and .php

    I'm sorry but I have this same problem, I am saving in /var/www and how do I fix this? I didn't understand T31's solution. Thank you.

  9. #9
    Join Date
    Jan 2005
    Beans
    48
    Distro
    Ubuntu Breezy 5.10

    Re: apache and .php

    Just to be clear I did everything I read in this thread trying to fix this same problem. Then I went into Root terminal and inputted the above commands:

    ln -s /etc/apache2/mods-available/php4.conf /etc/apache2/mods-enabled/php4.conf

    ln -s /etc/apache2/mods-available/php4.load /etc/apache2/mods-enabled/php4.load

    /etc/init.d/apache2 restart

    Which created the appropriate links I needed in mods-enabled then restarted the web server. But I still get the message popping up telling me it needs to know what to open the file as.

    The strange thing is I've had this working before, but when I updated my apache2 version this started happening. My old install of phpmyadmin (which is linked to in /var/www) works! but none of my websites (which are also linked to in /var/www) do.



    Please help!
    Last edited by Nolgthorn; May 18th, 2005 at 12:16 PM. Reason: mods-available = mods-enabled, fixed

  10. #10
    Join Date
    Jan 2005
    Beans
    48
    Distro
    Ubuntu Breezy 5.10

    Re: apache and .php

    hmm, nevermind! It fixed itself after about 20mins... damn that's annoying yet relieving. Too bad ONE of my websites still doesn't come up. it's got to be a cache problem but that doesn't seem to be fixing it. I'll turn off my computer and come back to it in the morning.

    Thanks you guys (women) nevermind me. Carry on.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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