Page 1 of 1

PH

PostPosted: 30. June 2011 20:05
by Harpist
Hi folks,

Just installed XAMPP 1.7.4 V6 on my Windows XP computer (SP3). I started up the server, and when I attempted to run a PHP script - instead of running - it just displayed the code. I then modified c:\xampp\apache\conf\httd.conf and added:

Code: Select all
LoadModule php5_module "C:/xampp/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/xampp/php"

When I tried to restart apache it would not restart. My wbemess.log displayed:

Thu Jun 30 11:56:46 2011.7575828) : Failed to log an event: 5DE
(Thu Jun 30 11:56:46 2011.7575828) : NT Event Log Consumer: could not retrieve sid, 0x80041002
(Thu Jun 30 11:56:46 2011.7575828) : Failed to log an event: 5DE
(Thu Jun 30 11:56:46 2011.7575828) : NT Event Log Consumer: could not retrieve sid, 0x80041002
(Thu Jun 30 11:56:46 2011.7575828) : Failed to log an event: 5DE
(Thu Jun 30 11:56:46 2011.7575828) : Dropping event destined for event consumer NTEventLogEventConsumer="SCM Event Log Consumer" in namespace //./root/subscription
(Thu Jun 30 11:56:46 2011.7575828) : Dropping event destined for event consumer NTEventLogEventConsumer="SCM Event Log Consumer" in namespace //./root/subscription
(Thu Jun 30 11:56:46 2011.7575828) : Dropping event destined for event consumer NTEventLogEventConsumer="SCM Event Log Consumer" in namespace //./root/subscription
(Thu Jun 30 11:56:46 2011.7575828) : Failed to deliver an event to event consumer NTEventLogEventConsumer="SCM Event Log Consumer" with error code 0x80041001. Dropping event.


By trial and error, I found that the line that is causing the problem is:

Code: Select all
PHPIniDir "C:/xampp/php"


However, without it I am still seeing code.

Any and all help would be appreciated. I have seen a number of solutions in this and other forums (including taking out some of the mysql dlls in the php.ini file) but I have had no luck.

Thank you for your assistance.

Harpist

Re: PH

PostPosted: 01. July 2011 00:52
by JonB
did you write the code????

If so, check your syntax for Short Open Tags

if not, check your syntax for Short Open Tags

http://stackoverflow.com/questions/2006 ... ble-to-use

http://bravo.newnetenterprises.com/word ... he-browser

good luck
8)

Re: PH

PostPosted: 01. July 2011 02:06
by Sharley
Harpist wrote:...I then modified c:\xampp\apache\conf\httd.conf and added:

Code: Select all
LoadModule php5_module "C:/xampp/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/xampp/php"
That is incorrect and will be overridden by the following entry that is read after the httpd.conf file.
(All configuration files in the extra folder will override any similar entries in the httpd.conf file, so best leaving the httpd.conf file in it's default state and effecting and required changes in these extra configuration files - after making backup copies first).

This is the correct entry which is already included in the C:\xampp\apache\conf\extra\httpd-xampp.conf file and will be the setting that Apache will use
Code: Select all
#
# PHP-Module setup
#
LoadFile "C:/xampp/php/php5ts.dll"
LoadModule php5_module modules/php5apache2_2.dll

<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>
So I suggest you return the httpd.conf file to it's original state and follow the short_open_tags advice given by JonB.

Also when Apache can't start the C:\xampp\apache\logs\error.log file may hold more relevant clues.

Re: PH

PostPosted: 01. July 2011 23:02
by Harpist
Sharley,

I saw that I was making that mistake when I went to running apache from a command line and the error was outputted to the screen. The short_open_tags did not make a difference (some scripts were already configured with this). The problem turned out to be the use of a .php5 extension (all the files that were not being rendered were from an older website). Once I changed everything to .php, it worked fine.

Thank you for your assistance.

Harpist