Annoying problem installing Apache1.3x+PHP4, Please HELP!

Discussion in 'Apache' started by jakes01, Sep 2, 2006.

  1. #1
    hey all this is the scenario :

    i downloaded apache 1.3x (latest version), php4 (latest version), i wanted to install php using the static method.

    In Apache src directory (apache_1.3.14/)
    # ./configure --prefix=/usr/local/apache


    In PHP src directory (php-4.0.3pl1/)
    # ./configure --with-mysql \
    --with-xml \
    --enable-track-vars \
    --with-apache=../apache_1.3.14 \

    # make
    # make install

    In Apache src directory (apache_1.3.14)
    # ./configure --prefix=/usr/local/apache \
    --enable-module=rewrite \
    --activate-module=src/modules/php4/libphp4.a

    # make
    # make install

    now apache works fine, cgi scripts work as well. i added addtype application/x-httpd-php php to the httpd.conf , then i tested a script php after chmod 755 , i keep getting "(8) exec format error", next line "premature end of script headers"

    im using the phpinfo.php test file,

    <?
    phpinfo();
    ?>

    help me out out please, thanks.

    jake
     
    jakes01, Sep 2, 2006 IP
  2. Lora Kok

    Lora Kok Well-Known Member

    Messages:
    182
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    118
    #2
    Can this help you?

    http://www.faqts.com/knowledge_base/view.phtml/aid/5605
    Check httpd.conf within the <IfModule mod_mime.c> directive to make sure
    that:
    1) You have:
    AddType application/x-httpd-php .php
    2) You DON'T have .php listed here:
    AddHandler cgi-script .cgi

    You should also check to be sure that the php script is not in a
    directory listed in the ScriptsAlias section as there it will be
    executed as a normal unix script, instead it should be in a normal
    directory of web pages. (This took me rather a while to figure out.)
     
    Lora Kok, Sep 2, 2006 IP
  3. Shoemoney

    Shoemoney $

    Messages:
    4,474
    Likes Received:
    588
    Best Answers:
    0
    Trophy Points:
    295
    #3
    check to make sure your file doesnt have weirdo dos charectors
     
    Shoemoney, Sep 2, 2006 IP
  4. jakes01

    jakes01 Guest

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hey thanks dude thanks alot, the addtype directive was already there so i tried changing the directory and boom it worked! thanks sooo much i spent like 2 days researching that error :p

    jake
     
    jakes01, Sep 3, 2006 IP