0

Xampp is telling me that apache and php are up and running properly, but viewing html pages with <?php ?> tags in the apache doc root folder is not doing anything with the php code, i can see the php code when viewing source via firefox. I've experimented with every piece of advice in configuring apache and php i could possibly find on forms and the official docs, and now im so exasperated by seeing nothing but white space, im at my end in desperation to get this working. What i've added or altered to configure the apache http.conf files:

LoadFile "c:/xampp/php/php5ts.dll"
LoadModule php5_module "c:/xampp/apache/modules/php5apache2_2.dll"
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
AddType application/x-httpd-php .php
AddType text/html .php .phps
DocumentRoot "C:/xampp/htdocs"
<IfModule dir_module>
    DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm default.php default.pl default.cgi default.asp default.shtml default.html default.htm home.php home.pl home.cgi home.asp home.shtml home.html home.htm
</IfModule>

And to the php.ini file I have:

error_reporting = E_ALL & E_NOTICE & E_DEPRECATED & E_STRICT
display_errors = On
display_startup_errors = On
default_mimetype = "text/html"
extension_dir = "C:\xampp\php\ext"
doc_root = "C:\xampp\htdocs"
extension=php_mysql_libmysql.dll

all other flavors of sql extensions are commented out

i have php.ini in the Windows/SYSTEM32 folder, i have c:/xampp/php in path and class path variables

so all in all, the apache server is processing my http://localhost/ requests, but nothing is being done with the php. ive reseted and reinstalled and now just cant for the life of me get this to work. my technical savvy being just slightly above a wild primate, please spell out fully and unambiguously any resolutions that you might think of.

the html file:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1-transional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 </head>
 <body>
 <h1>the heading h1</h1>
<?php phpinfo();
?>
 </body>
<html>

Edited by gakusya: n/a

7
Contributors
14
Replies
15
Views
6 Years
Discussion Span
Last Post by nicksontinko
0

Hi all,

Please paste here the error you find inside the following file,

xampp/apache/logs/error.log

Before posting it there, clear everything from this file and restart the xampp server. And then see whether you get any error here or not :-)

Thanks, Akshat

0

here is the apache error log file:

[Sat Jan 15 14:55:45 2011] [warn] module php5_module is already loaded, skipping
[Sat Jan 15 14:55:47 2011] [warn] module php5_module is already loaded, skipping
[Sat Jan 15 14:55:47 2011] [notice] Digest: generating secret for digest authentication ...
[Sat Jan 15 14:55:47 2011] [notice] Digest: done
[Sat Jan 15 14:55:48 2011] [notice] Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.5 mod_autoindex_color mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Sat Jan 15 14:55:48 2011] [notice] Server built: Nov 11 2009 14:29:03
[Sat Jan 15 14:55:48 2011] [notice] Parent: Created child process 1376
[Sat Jan 15 14:55:48 2011] [warn] module php5_module is already loaded, skipping
[Sat Jan 15 14:55:50 2011] [warn] module php5_module is already loaded, skipping
[Sat Jan 15 14:55:50 2011] [notice] Digest: generating secret for digest authentication ...
[Sat Jan 15 14:55:50 2011] [notice] Digest: done
[Sat Jan 15 14:55:51 2011] [notice] Child 1376: Child process is running
[Sat Jan 15 14:55:51 2011] [notice] Child 1376: Acquired the start mutex.
[Sat Jan 15 14:55:51 2011] [notice] Child 1376: Starting 150 worker threads.
[Sat Jan 15 14:55:51 2011] [notice] Child 1376: Starting thread to listen on port 443.
[Sat Jan 15 14:55:51 2011] [notice] Child 1376: Starting thread to listen on port 80.

perhaps the problem should be obvious at this point, but really this all greek to me

0

> viewing html pages with <?php ?>

May be a stupid question, but have the files got a .htm or .html extension? If so, change them to .php

0

I would follow ardav advice and if problem persists, I would backup my databases and htdocs and reinstall everything in XAMPP thing

0

tried using both html and php extensions on the file but that didnt solve anything. also ive already tried re-installation also with no difference whatsoever. at this point i just want to start practicing the actual php coding, is there ide or other way to render html/css with embedded php?

0

usually you should have php installed on your machine to use an ide. For ides try eclipse or aptana, or even netbeans. There's also a web based http://phpanywhere.net/

you can't render css with php unless the css file has a php extension. That's probably not the best way to go. you shouldn't need to use php inside css. Of course you can php-ify style tag contents.

//EDIT

I think the php.ini should be in the xampp directory. Also check out

C:\xampp\apache\conf\extra\httpd-vhosts.conf

for
something like:

<

VirtualHost *:80>
  DocumentRoot c:/xampp/htdocs
  ServerName localhost
</VirtualHost>

<VirtualHost *:80>
  DocumentRoot c:/xampp/htdocs/anynewsite
  ServerName myname.local
</VirtualHost>

AND

C:\Windows\System32\drivers\etc\hosts

for
something like:

127.0.0.1       localhost
::1             localhost
127.0.0.1 	myname.local

to ensure that localhost and any virtual hosts are referenced properly

Edited by diafol: n/a

0

here is my file, i dont see

[Sun Jan 16 10:03:42 2011] [notice] Digest: generating secret for digest authentication ...
[Sun Jan 16 10:03:42 2011] [notice] Digest: done
[Sun Jan 16 10:03:42 2011] [notice] Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Sun Jan 16 10:03:42 2011] [notice] Server built: Nov 11 2009 14:29:03
[Sun Jan 16 10:03:42 2011] [notice] Parent: Created child process 616
[Sun Jan 16 10:03:45 2011] [notice] Digest: generating secret for digest authentication ...
[Sun Jan 16 10:03:45 2011] [notice] Digest: done
[Sun Jan 16 10:03:45 2011] [notice] Child 616: Child process is running
[Sun Jan 16 10:03:45 2011] [notice] Child 616: Acquired the start mutex.
[Sun Jan 16 10:03:45 2011] [notice] Child 616: Starting 150 worker threads.
[Sun Jan 16 10:03:45 2011] [notice] Child 616: Starting thread to listen on port 443.
[Sun Jan 16 10:03:45 2011] [notice] Child 616: Starting thread to listen on port 80.
[Sun Jan 16 10:03:45 2011] [notice] Child 616: Starting thread to listen on port 443.
[Sun Jan 16 10:03:45 2011] [notice] Child 616: Starting thread to listen on port 80.
0

I think the [warn] stuff that is coming in the error.conf is creating hindering the successful startup of PHP.
In my system also the error.log file contains content similar to as posted by @branding4you.

@gakusya when you reinstalled the whole XAMPP, then even the default files inside htdocs were not running?? is that the case..!!

0

There is one file you have to edit - just take a ; or # away from a line. Should be in the documentation.

0

well here we are a couple days later, i tried installing xampp again and testing the php just of a mere whim, and lo behold whaddya know the php processor is working, and i never even touched the httpd.config file. the only conclusion i can draw from this is that there does exist ghosts in your software. if i ever figure out why the b'tch wouldnt work ill post it right here on this form

0

Edit your Apache HTTPD.CONF file and remove "AddType text/html .php .phps", restart Apache and see what happens.

0

I would follow ardav advice as well as if problem persists, I would backup my databases and htdocs as well as reinstall everything in XAMPP thing

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.