Results 1 to 7 of 7

Thread: PHP downloading but not executing

Hybrid View

  1. #1
    Semp
    Guest

    PHP downloading but not executing

    Hello, I have never setup PHP on Apache before. Sad to say I have not had much success yet. When I request www.mysite.com/webmail/ my browser starts downloading my index.php file instead of executing it. I'm trying to get Squirrelmail up and running Does anyone have any ideas what I am doing wrong? I added the following lines to my httpd.conf file.

    AddType application/x-httpd-php .php
    DirectoryIndex index.php index.shtml index.html index.htm

    Thanks in advance!

  2. #2
    JimH
    Guest

    Re:PHP downloading but not executing

    Bare with me here, I am completely new to apache. These are the php lines I see in my httpd.conf.

    <IfDefine HAVE_PHP>
    LoadModule php_module modules/mod_php.so
    </IfDefine>
    <IfDefine HAVE_PHP3>
    LoadModule php3_module modules/libphp3.so
    </IfDefine>
    <IfDefine HAVE_PHP4>
    LoadModule php4_module modules/libphp4.so
    </IfDefine>

    <IfDefine HAVE_PHP>
    AddModule mod_php.c
    </IfDefine>
    <IfDefine HAVE_PHP3>
    AddModule mod_php3.c
    </IfDefine>
    <IfDefine HAVE_PHP4>
    AddModule mod_php4.c
    </IfDefine>

    <IfModule mod_dir.c>
    DirectoryIndex index.html index.htm index.shtml index.php index.php4 index.php3 index.phtml index.cgi
    </IfModule>

    #
    # AddType allows you to tweak mime.types without actually editing it, or to
    # make certain files to be certain types.
    #
    # For example, the PHP 3.x module (not part of the Apache distribution - see
    # http://www.php.net) will typically use:
    #
    <IfModule mod_php3.c>
    AddType application/x-httpd-php3 .php3
    AddType application/x-httpd-php3-source .phps
    </IfModule>
    #
    # And for PHP 4.x, use:
    #
    <IfModule mod_php4.c>
    AddType application/x-httpd-php .php .php4 .php3 .phtml
    AddType application/x-httpd-php-source .phps
    </IfModule>

    #
    # For PHP/FI (PHP2), use:
    #
    <IfModule mod_php.c>
    AddType application/x-httpd-php .phtml
    </IfModule>

    I don't know if this will help any. These lines are not all together in httpd.conf. PHP worked right after I installed it for me. I have only had a test box running apache for about a month and I haven't had much time to play with it yet.

    phpinfo(); doesnt return anything?

    I have this in the file phpinfo.php I created.

    <?php
    phpinfo();
    ?>

    Then I just access the file in the browser and it shows all the php info.

    Jim H

  3. #3
    Semp
    Guest

    Re:PHP downloading but not executing

    Thanks for the detailed reply. From looking at some of your httpd.conf file it looks like I didn't statically link PHP into Apache or as a module (I think). I have learned allot about PHP over the last three hours, heh. I will investigate this tomorrow when I get back into work and I will post my results. Thanks for the informative reply.

  4. #4

    Re:PHP downloading but not executing

    Don't forget your .htaccess file either....

    in that same directory...

    Addtype application/x-httpd-php .php .php3

    that is ur problem...or you can statically link it...which I don't prefer because sometimes I like to show my php code as text....but that might not be something you need/want....

    Aragorn
    If you give a man a fire he'll be warm, if you light the man on fire he'll be warm for life.

  5. #5
    JimH
    Guest

    Re:PHP downloading but not executing

    Quote Originally Posted by Aragorn
    Don't forget your .htaccess file either....

    Aragorn
    I have it in httpd.conf. I didnt have to add it to .htaccess. Look at my other post.

    Jim H

  6. #6

    Re:PHP downloading but not executing

    Quote Originally Posted by JimH
    I have it in httpd.conf. I didnt have to add it to .htaccess. Look at my other post.

    Jim H
    I know...I was telling him that he could get it to work immediately like that...that is how GLO is set up..that is why we had the problems with the .php3 file....I had to edit the .htaccess file! :P

    Aragorn
    If you give a man a fire he'll be warm, if you light the man on fire he'll be warm for life.

  7. #7
    JimH
    Guest

    Re:PHP downloading but not executing

    Quote Originally Posted by Aragorn
    I know...I was telling him that he could get it to work immediately like that...that is how GLO is set up..that is why we had the problems with the .php3 file....I had to edit the .htaccess file! :P

    Aragorn
    Yeah, I know, but that was because we don't have access to httpd.conf on the host's server.

    Jim H

Similar Threads

  1. Help with downloading Windows 7 RC
    By omidkamangar in forum Windows - General Topics
    Replies: 2
    Last Post: 08-26-2009, 12:31 AM
  2. error when executing script
    By xylex_blaiste in forum Programming
    Replies: 6
    Last Post: 02-07-2007, 11:57 PM
  3. Executing genlogon from smb.conf
    By vba_djs in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 12-08-2006, 12:04 AM
  4. mplayer & downloading mp3
    By mojo jojo in forum General Chat
    Replies: 1
    Last Post: 09-01-2003, 11:47 AM
  5. MOVED: PHP downloading but not executing
    By paradox in forum Linux - Software, Applications & Programming
    Replies: 0
    Last Post: 02-26-2002, 06:19 AM

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
  •