test.php not displayed correctly- just the text is displayed
Moderator: General Moderators
test.php not displayed correctly- just the text is displayed
I am a new user of php/apache and was trying to set it up on my box. Despite my repeated attempt, I can't get apache to recognize the php code correctly; apache treats it as a text. When I do view source, I see the php text. I have added these three files in my httpd.conf
LoadModule php5_module "D:/Apps/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "D:/Apps/PHP"
I have verified to make sure that the path are abolutely correct. Also php.ini files does exist in d:/apps/PHP directory.
I am using 2.0.59 version of apache and PHP 5.1.6 version. Any help would be highly appreciated. (I have also tried to set the doc_path in php.ini to to the ../htdocs directory but that does not do any good.
I know the apache is working fine since I can pull up the index.html just fine. The problem is making apache recognize the php file
Thanks
SS
LoadModule php5_module "D:/Apps/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "D:/Apps/PHP"
I have verified to make sure that the path are abolutely correct. Also php.ini files does exist in d:/apps/PHP directory.
I am using 2.0.59 version of apache and PHP 5.1.6 version. Any help would be highly appreciated. (I have also tried to set the doc_path in php.ini to to the ../htdocs directory but that does not do any good.
I know the apache is working fine since I can pull up the index.html just fine. The problem is making apache recognize the php file
Thanks
SS
Right after loadmodule section
LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so
#Added by me
LoadModule php5_module "D:/Apps/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "D:/Apps/PHP"
I have tried to add addtype at the bottom (with two other add types), and when that did not work, I tried this approach.
BTW, FYI - I had a virus infecting my computer a month back. I have cleaned that up using avast. But I wonder could it be some kind of lingering effect of that virus.
Another note, I do see php configured correctly from the error.log file (in apache directory)
[Tue Oct 17 08:57:33 2006] [notice] Apache/2.0.59 (Win32) PHP/5.1.6 configured -- resuming normal operations
[Tue Oct 17 08:57:33 2006] [notice] Server built: Jul 27 2006 15:55:03
[Tue Oct 17 08:57:33 2006] [notice] Parent: Created child process 520
[Tue Oct 17 08:57:33 2006] [notice] Child 520: Child process is running
[Tue Oct 17 08:57:33 2006] [notice] Child 520: Acquired the start mutex.
[Tue Oct 17 08:57:33 2006] [notice] Child 520: Starting 250 worker threads.
[Tue Oct 17 09:07:23 2006] [notice] Parent: Received restart signal -- Restarting the server.
[Tue Oct 17 09:07:23 2006] [notice] Child 520: Exit event signaled. Child process is ending.
Not sure what is it that apache is reporting as an error in these messages.
LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so
#Added by me
LoadModule php5_module "D:/Apps/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "D:/Apps/PHP"
I have tried to add addtype at the bottom (with two other add types), and when that did not work, I tried this approach.
BTW, FYI - I had a virus infecting my computer a month back. I have cleaned that up using avast. But I wonder could it be some kind of lingering effect of that virus.
Another note, I do see php configured correctly from the error.log file (in apache directory)
[Tue Oct 17 08:57:33 2006] [notice] Apache/2.0.59 (Win32) PHP/5.1.6 configured -- resuming normal operations
[Tue Oct 17 08:57:33 2006] [notice] Server built: Jul 27 2006 15:55:03
[Tue Oct 17 08:57:33 2006] [notice] Parent: Created child process 520
[Tue Oct 17 08:57:33 2006] [notice] Child 520: Child process is running
[Tue Oct 17 08:57:33 2006] [notice] Child 520: Acquired the start mutex.
[Tue Oct 17 08:57:33 2006] [notice] Child 520: Starting 250 worker threads.
[Tue Oct 17 09:07:23 2006] [notice] Parent: Received restart signal -- Restarting the server.
[Tue Oct 17 09:07:23 2006] [notice] Child 520: Exit event signaled. Child process is ending.
Not sure what is it that apache is reporting as an error in these messages.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
This is what my Apache configration looks like. I am on WinXP, Apache 2.0 and PHP5.1.6. Note: This is at the end of the conf file.
Code: Select all
# Added by me to allow for PHP5 use
# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php"The way I am accessing the php script is 1. Create a test.php file in htdocs directory. 2. put the text string <?phpinfo();?> in the test.php 3. Go to browser and type in localhost/test.php
The engine directive is on (I basically took the php.ini.recommended, and copied it as php.ini)
The apache directory does not have any .htaccess in it. Is there a way to see if the php is installed correctly (all I did to install php was unzip the downloaded file. are there other steps, like updating the path to get this install correctly)
The engine directive is on (I basically took the php.ini.recommended, and copied it as php.ini)
The apache directory does not have any .htaccess in it. Is there a way to see if the php is installed correctly (all I did to install php was unzip the downloaded file. are there other steps, like updating the path to get this install correctly)
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia