| Author |  | 
| b3wii 
 
 
 Joined: 11 Oct 2011
 Posts: 4
 
 
 | 
|  Posted: Wed 12 Oct '11 12:49    Post subject: Apache2.2 php5.2.17 problem |   |  
| 
 |  
| hi, 
 i have problems setting up my apache with php5.
 
 What i did is download apache2.2 extracted content of msi to a directory and downloaded php5.2.17.
 
 At first i copied php5ts.dll to system32.
 Then i configured httpd.conf:
 
 - PHPIniDir ...
 - LoadModule php5_module ...
 - AddType application/x-httpd-php .php
 
 Ok, so now my server is up running without any problems but when i run a php file with the content of <?php phpinfo(); ?> the browser just displays the source code and access.log displays this error: "GET /phpinfo.php HTTP/1.1" 304.
 
 Please help
 |  | 
| Back to top |  | 
| James Blond Moderator
 
  
 Joined: 19 Jan 2006
 Posts: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Thu 13 Oct '11 13:02    Post subject: |   |  
| 
 |  
| 304 is ok, it means the content did not change since the last time. |  | 
| Back to top |  | 
| b3wii 
 
 
 Joined: 11 Oct 2011
 Posts: 4
 
 
 | 
|  Posted: Thu 10 Nov '11 17:31    Post subject: Apache2.2 php5.2.17 problem |   |  
| 
 |  
| @James Blond 
 thnx for answering.
 My problem is that the server doesnt execute the php code.. for example when i run a php file with <?php phpinfo(); ?> the browser shows this as text...?
 
 please help
 
 error.log
 
  	  | Code: |  	  | Starting the Apache2.2 service
 The Apache2.2 service is running.
 ] Apache/2.2.21 (Win32) PHP/5.2.17 configured -- resuming normal operations
 [Thu Nov 10 16:24:00 2011] [notice] Server built: Sep  9 2011 10:26:10
 [Thu Nov 10 16:24:00 2011] [notice] Parent: Created child process 2196
 [Thu Nov 10 16:24:00 2011] [debug] mpm_winnt.c(477): Parent: Sent the scoreboard to the child
 [Thu Nov 10 16:24:00 2011] [notice] Child 2196: Child process is running
 [Thu Nov 10 16:24:00 2011] [debug] mpm_winnt.c(398): Child 2196: Retrieved our scoreboard from the parent.
 [Thu Nov 10 16:24:00 2011] [info] Parent: Duplicating socket 336 and sending it to child process 2196
 [Thu Nov 10 16:24:00 2011] [debug] mpm_winnt.c(595): Parent: Sent 1 listeners to child 2196
 [Thu Nov 10 16:24:00 2011] [debug] mpm_winnt.c(554): Child 2196: retrieved 1 listeners from parent
 [Thu Nov 10 16:24:00 2011] [notice] Child 2196: Acquired the start mutex.
 [Thu Nov 10 16:24:00 2011] [notice] Child 2196: Starting 64 worker threads.
 [Thu Nov 10 16:24:00 2011] [notice] Child 2196: Starting thread to listen on port 8080.
 
 | 
 
 access.log
 
  	  | Code: |  	  | 127.0.0.1 - - [10/Nov/2011:16:22:15 +0100] "GET / HTTP/1.1" 404 198 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:8.0a1) Gecko/20110706 Firefox/8.0a1"
 127.0.0.1 - - [10/Nov/2011:16:22:15 +0100] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:8.0a1) Gecko/20110706 Firefox/8.0a1"
 127.0.0.1 - - [10/Nov/2011:16:22:15 +0100] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:8.0a1) Gecko/20110706 Firefox/8.0a1"
 127.0.0.1 - - [10/Nov/2011:16:22:15 +0100] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:8.0a1) Gecko/20110706 Firefox/8.0a1"
 127.0.0.1 - - [10/Nov/2011:16:24:12 +0100] "GET / HTTP/1.1" 404 198 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:8.0a1) Gecko/20110706 Firefox/8.0a1"
 127.0.0.1 - - [10/Nov/2011:16:24:28 +0100] "GET /phpinfo.php HTTP/1.1" 200 19 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:8.0a1) Gecko/20110706 Firefox/8.0a1"
 
 | 
 |  | 
| Back to top |  | 
| James Blond Moderator
 
  
 Joined: 19 Jan 2006
 Posts: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Fri 11 Nov '11 3:02    Post subject: |   |  
| 
 |  
| replace 
  	  | Code: |  	  | AddType application/x-httpd-php .php
 
 | 
 
 with
 
  	  | Code: |  	  | AddHandler application/x-httpd-php .php
 
 | 
 
 restart apache and try again.
 |  | 
| Back to top |  | 
| b3wii 
 
 
 Joined: 11 Oct 2011
 Posts: 4
 
 
 | 
|  Posted: Fri 11 Nov '11 16:51    Post subject: |   |  
| 
 |  
| hi James Blond, 
 i did as you said but got the following error:
 
 cmd:
 
  	  | Code: |  	  | C:\Apache Software Foundation\Apache2.2\bin>httpd -k start
 Syntax error on line 305 of C:/Apache Software Foundation/Apache2.2/conf/httpd.c
 onf:
 Invalid command 'AddHandler', perhaps misspelled or defined by a module not incl
 uded in the server configuration
 
 | 
 
 line 305 = AddHandler application/x-httpd-php .php
 
 httpd.conf
 
  	  | Code: |  	  | ServerRoot "C:/Apache Software Foundation/Apache2.2"
 
 
 Listen 8080
 
 LoadModule authz_host_module modules/mod_authz_host.so
 LoadModule alias_module modules/mod_alias.so
 LoadModule userdir_module modules/mod_userdir.so
 #LoadModule mime_module modules/mod_mime.so
 LoadModule setenvif_module modules/mod_setenvif.so
 LoadModule log_config_module modules/mod_log_config.so
 
 <IfModule !mpm_netware_module>
 <IfModule !mpm_winnt_module>
 
 User daemon
 Group daemon
 
 </IfModule>
 </IfModule>
 
 
 ServerAdmin you@example.com
 
 
 ServerName localhost:8080
 
 
 DocumentRoot "C:/Apache Software Foundation/www"
 
 
 <Directory />
 Options FollowSymLinks
 AllowOverride None
 Order deny,allow
 Deny from all
 </Directory>
 
 
 <Directory "C:/Apache Software Foundation/www">
 
 Options Indexes FollowSymLinks
 
 AllowOverride None
 
 Order allow,deny
 Allow from all
 
 </Directory>
 
 Alias /typo3cms "C:/Apache Software Foundation/typo3cms/"
 <Directory "C:/Apache Software Foundation/typo3cms/">
 Options Indexes Includes FollowSymLinks SymLinksifOwnerMatch
 AllowOverride All
 Order allow,deny
 Allow from all
 </Directory>
 
 UserDir "C:/Apache Software Foundation/"
 
 <IfModule dir_module>
 DirectoryIndex index.html
 </IfModule>
 
 <FilesMatch "^\.ht">
 Order allow,deny
 Deny from all
 Satisfy All
 </FilesMatch>
 
 ErrorLog "C:/Apache Software Foundation/log/apache/error.log"
 
 LogLevel debug
 
 <IfModule log_config_module>
 
 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
 LogFormat "%h %l %u %t \"%r\" %>s %b" common
 
 <IfModule logio_module>
 # You need to enable mod_logio.c to use %I and %O
 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
 </IfModule>
 
 CustomLog "C:/Apache Software Foundation/log/apache/access.log" combined
 
 </IfModule>
 
 <IfModule alias_module>
 
 #    ScriptAlias /cgi-bin/ "@exp_cgidir@/"
 
 </IfModule>
 
 <IfModule cgid_module>
 
 </IfModule>
 
 <Directory "@exp_cgidir@">
 AllowOverride None
 Options None
 Order allow,deny
 Allow from all
 </Directory>
 
 Loadfile "C:\Apache Software Foundation\php5.2.17\php5ts.dll"
 
 LoadModule php5_module "C:\Apache Software Foundation\php5.2.17\php5apache2_2.dll"
 
 PHPIniDir "C:\Apache Software Foundation\php5.2.17"
 
 #Hook the php file extensions
 AddHandler application/x-httpd-php .php
 AddHandler application/x-httpd-php-source .phps
 
 DefaultType text/plain
 
 <IfModule mime_module>
 
 TypesConfig "C:\Apache Software Foundation\Apache2.2\conf\mime.types"
 
 AddType application/x-compress .Z
 AddType application/x-gzip .gz .tgz
 
 </IfModule>
 
 Alias /icons/ "C:/Apache Software Foundation/Apache2.2/icons/"
 
 <Directory "C:/Apache Software Foundation/Apache2.2/icons">
 Options Indexes MultiViews
 AllowOverride None
 Order allow,deny
 Allow from all
 </Directory>
 
 <Directory "C:/Apache Software Foundation/Apache2.2/manual">
 Options Indexes
 AllowOverride None
 Order allow,deny
 Allow from all
 
 <Files *.html>
 SetHandler type-map
 </Files>
 
 SetEnvIf Request_URI ^/manual/de/ prefer-language=de
 SetEnvIf Request_URI ^/manual/en/ prefer-language=en
 SetEnvIf Request_URI ^/manual/fr/ prefer-language=fr
 SetEnvIf Request_URI ^/manual/ja/ prefer-language=ja
 SetEnvIf Request_URI ^/manual/ko/ prefer-language=ko
 SetEnvIf Request_URI ^/manual/ru/ prefer-language=ru
 RedirectMatch 301 ^/manual(?:/(de|en|fr|ja|ko|ru)){2,}(/.*)?$ /manual/$1$2
 </Directory>
 
 
 <IfModule ssl_module>
 SSLRandomSeed startup builtin
 SSLRandomSeed connect builtin
 </IfModule>
 
 
 | 
 
 i think theres a tiny error somewhere in my conf file but i cant find it.. it would be very kind if you could take a look at it. thnx
 
 sorry for my english i'm german
 |  | 
| Back to top |  | 
| James Blond Moderator
 
  
 Joined: 19 Jan 2006
 Posts: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Fri 11 Nov '11 18:42    Post subject: |   |  
| 
 |  
| You need to load the mime module. Remove the # before that line. |  | 
| Back to top |  | 
| b3wii 
 
 
 Joined: 11 Oct 2011
 Posts: 4
 
 
 | 
|  Posted: Fri 11 Nov '11 18:49    Post subject: |   |  
| 
 |  
| yeeehaaw! thank you james!! 
 deleted the cache from firefox removed the # and restarted server now php script gets executed.
 
 thanx so much =)
 |  | 
| Back to top |  |