Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: .php files don't want to run!!!!

  1. #11

    Re: .php files don't want to run!!!!

    i've got it going. no avail.

    thanks,

    ephman

  2. #12
    Join Date
    Dec 2006
    Location
    Chicago
    Beans
    3,839

    Re: .php files don't want to run!!!!

    Code:
    sudo apt-get install libapache2-mod-php5
    sudo a2enmod php5
    sudo /etc/init.d/apache2 restart
    PHP is a server-side scripting language. Your browser will not interpret PHP code. It has to be accessed through apache (http://localhost/). GD is a module you can use from php, it doesn't enable browsers or web servers to interpret php code.

  3. #13
    Join Date
    Apr 2008
    Location
    Arnhem, Netherlands
    Beans
    7
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: .php files don't want to run!!!!

    how are you opening the file?
    through http://localhost/ or through file://* ?
    if you do it by file:// it is not done by the server and so php is never even triggered.

    this might seem a stupid reply but it happens more than you think (me, me, choose me!)

  4. #14
    Join Date
    Apr 2006
    Location
    Trondheim, Norway
    Beans
    278
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: .php files don't want to run!!!!

    chmod +x file.php

  5. #15
    Join Date
    Aug 2007
    Beans
    34

    Re: .php files don't want to run!!!!

    I have php-http , libapache2-mod-php5 , php-pear , php5 , php5-cli , php5-common and php5-imap installed. I think you need the first two for php pages to work.

  6. #16

    Re: .php files don't want to run!!!!

    Quote Originally Posted by jojotjuh View Post
    how are you opening the file?
    through http://localhost/ or through file://* ?
    if you do it by file:// it is not done by the server and so php is never even triggered.

    this might seem a stupid reply but it happens more than you think (me, me, choose me!)
    duh!!!!!! i was accessing it through file:// the crazier i was getting over this simple simple thing the harder and more complicated it was getting for me. and i knew i swear i knew it was such a simple thing. there was really no reason for php to stop working like that. so funny. thank you everybody for your help.

    thanks for your bandwidth,

    ephman

  7. #17
    Join Date
    May 2008
    Beans
    3

    Re: .php files don't want to run!!!!

    I ended up following the instructions here: http://dan.drydog.com/apache2php.html and everything seems to be working. I haven't done anything with mysql yet though.

    I also needed to apt-get install 'libxml2-dev' and 'libmysqlclient15-dev' for the key ./configure options to work.

    i am using ubuntu 8.04 with apache 2.2.8 and php 5.2.5

    good luck to the rest of you

  8. #18
    Join Date
    Aug 2006
    Beans
    18

    Re: .php files don't want to run!!!!

    Quote Originally Posted by cdenley View Post
    Code:
    sudo apt-get install libapache2-mod-php5
    sudo a2enmod php5
    sudo /etc/init.d/apache2 restart
    PHP is a server-side scripting language. Your browser will not interpret PHP code. It has to be accessed through apache (http://localhost/). GD is a module you can use from php, it doesn't enable browsers or web servers to interpret php code.
    FYI, for anyone reading this, I had this same problem. libapache2-mod-php5, apache2, mysql, PEAR, everything (as far as I could tell) that needed to be was installed. Still Apache kept giving me a download dialog for the php files instead of running them. I don't know what was wrong, but I ran your commands and they worked. The

    Code:
    sudo a2enmod php5
    seemed to be what did it. I guess the php module needed to be enabled.

    So thanks!!

  9. #19
    Join Date
    Sep 2007
    Beans
    7

    Re: .php files don't want to run!!!!

    hello guys

    I thought I should comment since things kind of were up in the air as to the culprit for the errors. I was lead to this post for the same reason everyone else was I guess (my php files were trying to download and save rather then being ran by the server side script interpreter.

    One person I noticed said after enabling php their scripts worked but I wonder how many people do what I did and not pay attention to the order in which they install apache and php.

    What ends up happening is that installing apache first and then php without restarting apache leaves your php scripts trying to download.

    I needed to restart the apache server and the php scripts ran without issue. Thanks to the post with the list of commands I ran them one by one only to be told by the prompt that the packages were already installed but after restarting the apache server tadah! it worked.

    By the way this was the command:
    Code:
    sudo /etc/init.d/apache2 restart

  10. #20
    Join Date
    Dec 2008
    Location
    Norfolk, Va
    Beans
    3
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: .php files don't want to run!!!!

    What's mod-php?

Page 2 of 2 FirstFirst 12

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
  •