Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

apache not processing PHP

  • 12-03-2008 11:29AM
    #1
    Registered Users, Registered Users 2 Posts: 1,000 ✭✭✭


    I've been at this for hours and can't figure it out. :rolleyes:

    I have apache 1.3 installed on an XP machine. It runs fine.
    I installed PHP5, it added these lines to my httpd.conf file:
    #BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
    PHPIniDir "D:/Program Files/PHP/"
    LoadModule php5_module "D:/Program Files/PHP/php5apache.dll"
    #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
    Now apache won't restart, error is:
    Invalid command 'PHPIniDir', perhaps misspelled or defined by a module not included in the server configuration.

    I have googled the error and tried every fix suggested, but no luck!
    Maybe it's something simple, but I can't see it?


Comments

  • Registered Users, Registered Users 2 Posts: 1,000 ✭✭✭MargeS


    I uninstalled PHP from d: and reinstalled to c:
    The installation updates the httpd.conf file to reflect the change to the c drive.
    But I get the same errors and apache won't start.

    I am getting no errors written to the log file.


  • Registered Users, Registered Users 2 Posts: 6,677 ✭✭✭daymobrew


    Try putting PHPIniDir after the LoadModue line. Apache doesn't know about the PHPIniDir command but PHP does.

    In the Apache on Windows instructions is has:
    # Add to the end of the LoadModule section
    LoadModule php5_module "C:/php/php5apache.dll"
    
    # Add to the end of the AddModule section
    AddModule mod_php5.c
    
    but no mention of PHPIniDir. If moving it doesn't work, you could try commenting it out.

    Another idea is to use XAMPP - it has Apache 2, PHP 5, MySQL, Filezilla and perl (and more). All configured and ready to go.


  • Registered Users, Registered Users 2 Posts: 1,000 ✭✭✭MargeS


    By rearranging:
    LoadModule php5_module "C:/PHP/php5apache.dll"
    PHPIniDir "C:/PHP/"

    apache restarted.....but my php is not getting processed. Browser just writes out the PHP code.
    My head is fried!


  • Closed Accounts Posts: 382 ✭✭misterq


    I'm surprised you didn't see this in the installation documentation:
    AddType application/x-httpd-php .php

    Apache needs to know that .php files are processed via php


  • Registered Users, Registered Users 2 Posts: 1,000 ✭✭✭MargeS


    misterq wrote: »
    I'm surprised you didn't see this in the installation documentation:
    AddType application/x-httpd-php .php
    These are in the conf file already:
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps


    I uninstalled/reintalled PHP using php-5.2.5-win32-installer.msi
    While I had to comment out a lot of lines in php.ini as it wasn't finding dll's in the ext folder....(yes, I checked my environment PATH and it does point to the correct place)
    I am getting these errors in my apache error log file:
    Error in my_thread_global_end(): 3 threads didn't exit
    stant XML_NOTATION_NODE already defined in Unknown on line 0
    PHP Notice: Constant XML_HTML_DOCUMENT_NODE already defined in Unknown on line 0
    PHP Notice: Constant XML_DTD_NODE already defined in Unknown on line 0
    PHP Notice: Constant XML_ELEMENT_DECL_NODE already defined in Unknown on line 0
    PHP Notice: Constant XML_ATTRIBUTE_DECL_NODE already defined in Unknown on line 0
    PHP Notice: Constant XML_ENTITY_DECL_NODE already defined in Unknown on line 0
    PHP Notice: Constant XML_NAMESPACE_DECL_NODE already defined in Unknown on line 0
    PHP Notice: Constant XML_LOCAL_NAMESPACE already defined in Unknown on line 0
    PHP Notice: Constant XML_ATTRIBUTE_CDATA already defined in Unknown on line 0
    PHP Notice: Constant XML_ATTRIBUTE_ID already defined in Unknown on line 0
    PHP Notice: Constant XML_ATTRIBUTE_IDREF already defined in Unknown on line 0
    PHP Notice: Constant XML_ATTRIBUTE_IDREFS already defined in Unknown on line 0
    PHP Notice: Constant XML_ATTRIBUTE_ENTITY already defined in Unknown on line 0
    PHP Notice: Constant XML_ATTRIBUTE_NMTOKEN already defined in Unknown on line 0
    PHP Notice: Constant XML_ATTRIBUTE_NMTOKENS already defined in Unknown on line 0
    PHP Notice: Constant XML_ATTRIBUTE_ENUMERATION already defined in Unknown on line 0
    PHP Notice: Constant XML_ATTRIBUTE_NOTATION already defined in Unknown on line 0
    Error in my_thread_global_end(): 1 threads didn't exit


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    To be honest before you waste anymore time you better off just uninstalling everything and installing WAMP or something like suggest above. It will be all configured.


  • Registered Users, Registered Users 2 Posts: 1,000 ✭✭✭MargeS


    thanks all for your replies. I'm a bit like a dog with a bone at the mo!
    But I can't get past the last list of errors... so I'm wasting time now. :rolleyes:

    Don't ya just love this work! :D


  • Closed Accounts Posts: 72 ✭✭fatjose101


    if you are still having problems configuring it, try using XAMPP.
    it installs apache & php together, so there's no need for configuration.


  • Closed Accounts Posts: 1,444 ✭✭✭Cantab.


    MargeS wrote: »
    thanks all for your replies. I'm a bit like a dog with a bone at the mo!
    But I can't get past the last list of errors... so I'm wasting time now. :rolleyes:

    Don't ya just love this work! :D

    I hope you're getting paid for it.

    WAMP = 10 mins.


Advertisement