logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Apache starts, but PHP won't do anything
Author
someone124



Joined: 18 Jun 2006
Posts: 4

PostPosted: Sun 18 Jun '06 9:32    Post subject: Apache starts, but PHP won't do anything Reply with quote

Hey everyone,

this is my first time setting this up, i'm on...
Wondows 2000 Sp 4
Apache 2.2.2
PHP 5.1.4
and MySQL 5.0.22

i'm trying to get a phpBB board running, but PHP refuses to actually work. Every time i try to load a page that is a .php file it just gives me all the text. This is what it looks like,
http://s34.photobucket.com/albums/d146/someone1_2_4/?action=view&current=lamerz.jpg

i've added the lines...


what is going on? Sad

Code:
# For PHP 5
LoadModule php5_module "E:/Dev/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php-source .phps

# configure the path to php.ini
PHPIniDir "E:/Dev/PHP"


with the paths changed to work on my computer, all the tuts are different, and none have worked. What's going on?

Thanks
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Sun 18 Jun '06 15:15    Post subject: Reply with quote

PHP is not runnig?? . Do any other php scripts run?

You may test with this: create a php file with
Code:

<?php
phpinfo();
?>


Any error in windows event log / apache error log or php error log?
Where did you add the line in your httpd.conf?

Installed Apache as service? If yes reastart it.
Back to top
filmstalker



Joined: 18 Jun 2006
Posts: 2

PostPosted: Sun 18 Jun '06 18:11    Post subject: Reply with quote

I am having this exact same problem.

Windows XP
.Net 2.0 installed
Apache 2.2
PHP 4.4.2
php4apache2.dll-php4.4.x.dll installed as per readme
Added correct lines to httpd.conf as per documentation
Paths setup correctly - cmd path shows it's okay
No errors in any logs - Apache logs show PHP loaded successfully

Everything else is working but a PHP file just displays as a text file rather than running. I just can't figure it out.

I've even added a small phpinfo() test script and that won't run.

Any suggestions would be appreciated.
Back to top
someone124



Joined: 18 Jun 2006
Posts: 4

PostPosted: Sun 18 Jun '06 19:28    Post subject: Reply with quote

How do i make a .php file, it won't let me, it just saves it as a .txt

and i added the lines at the very top of the httpd file

and is .net required? Embarassed
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Sun 18 Jun '06 20:51    Post subject: Reply with quote

Use a filename surround with quotes, eg. in notepad Filename "phpinfo.php"

Steffen
Back to top
someone124



Joined: 18 Jun 2006
Posts: 4

PostPosted: Mon 19 Jun '06 2:16    Post subject: Reply with quote

ok, so i got the test file working to save as a PHP file, but the PHP script didn't run so it just showed up as some text when i looked at it through my browser. Sad
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Mon 19 Jun '06 8:02    Post subject: Reply with quote

Are you restarting the Apache service after saving changes to your CONF file?

It sounds like the LoadModule directive for PHP is not being read, that is why I'm asking about restart.
..
Back to top
someone124



Joined: 18 Jun 2006
Posts: 4

PostPosted: Mon 19 Jun '06 23:31    Post subject: Reply with quote

nope, i'm restarting apache after i change stuff in the httpd file
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Tue 20 Jun '06 9:30    Post subject: Reply with quote

This is my entire CONF file (edited to arbitrary paths - but close enough to make sense):
Code:
ThreadsPerChild 250
MaxRequestsPerChild 0

ServerRoot "C:/Apache2"

Listen 80


LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule status_module modules/mod_status.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule ssl_module modules/mod_ssl.so

# Load PHP as a module
LoadModule php5_module "c:/php/php5apache2.dll"

ServerAdmin @@ServerAdmin@@

ServerName localhost:80

DocumentRoot "d:/Web"

<Directory />
      Options FollowSymLinks
      AllowOverride None
      Order deny,allow
      Deny from all
      Satisfy all
</Directory>

<Directory "d:/Web">
      Options Indexes FollowSymLinks
      AllowOverride None
      Order allow,deny
      Allow from all
</Directory>

<IfModule dir_module>
      DirectoryIndex index.htm index.html index.php
</IfModule>

<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>
            LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
      </IfModule>
      CustomLog logs/access.log combined
</IfModule>
<IfModule mime_module>
      TypesConfig conf/mime.types
      AddType application/x-compress .Z
      AddType application/x-gzip .gz .tgz

      # include the MIME TYPE for PHP
      AddType application/x-httpd-php .php
</IfModule>

DefaultType text/plain
<FilesMatch "^\.ht">
      Order allow,deny
      Deny from all
</FilesMatch>

ErrorLog logs/error.log

LogLevel crit

Include conf/extra/httpd-info.conf

Include conf/extra/httpd-manual.conf

Include conf/extra/httpd-default.conf

Include conf/extra/httpd-ssl.conf

Include conf/extra/httpd-vhosts.conf

PHPIniDir "C:/php"


I run PHP with an Apache CONF just like this without ANY problems - compare to what you have and note locations of PHP pertinent information.
..
Back to top
pedro2k



Joined: 17 Jun 2006
Posts: 16

PostPosted: Wed 21 Jun '06 19:34    Post subject: Reply with quote

OK i had the sampe problem,
I had to forgotten to add this line

AddType application/x-httpd-php .php

Have you added these three lines for php?
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"

This is all i added to the conf file and it worked!
Back to top
OldManRiver



Joined: 21 Jun 2006
Posts: 21

PostPosted: Thu 22 Jun '06 1:29    Post subject: Doesn't really work Reply with quote

I have PHP working in my PHP editor, because links directly but not in the localhost. Here is the .conf code for PHP:
Code:
DirectoryIndex index.html index.html.var index.shtml index.php

# Config for PHP
LoadModule php5_module "D:/Program Files/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "D:/Program Files/PHP"

ScriptAlias /cgi-bin/ "D:/Program Files/Apache/Apache2/cgi-bin/"
ScriptAlias /php/ "D:/Program Files/PHP/"
AddType text/html .shtml .htm .dhtm .dhtml .asp .aspx .php .php3 .phml .cfml
AddHandler cgi-script .cgi
AddHandler php-script .php .php3 .phml
AddHandler php .php .php3 .phml

<Directory "D:/Program Files/Apache/Apache2/cgi-bin">
  Options
  Allow from all
  Order allow,deny
  AllowOverride None
</Directory>

<Directory "D:/Program Files/PHP">
  Options
  Allow from all
  Order allow,deny
  AllowOverride None
</Directory>


What do I need to add or change?

OMR
Back to top
Siron



Joined: 11 Jun 2006
Posts: 6
Location: Utah / California

PostPosted: Thu 22 Jun '06 2:08    Post subject: Reply with quote

if you use <? ?> style tag's instead of the standard <?php ?> - try changing it and see if it works, if thats the case edit your php.ini file to have short_open_tag = On (or just change your tags).
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 22 Jun '06 17:35    Post subject: Reply with quote

remove AddHandler php .php .php3 .phml and AddHandler php-script .php .php3 .phml because you have allready declared that with AddType application/x-httpd-php .php
Also remove ScriptAlias /php/ "D:/Program Files/PHP/"
and the container for it. PHP loaded as module don't need that.
Back to top
filmstalker



Joined: 18 Jun 2006
Posts: 2

PostPosted: Sat 24 Jun '06 22:23    Post subject: Reply with quote

Mine is as per the installation instructions, and I'm still getting the text display rather than the PHP working. Any other areas to check?
Back to top
ibba



Joined: 25 Jun 2006
Posts: 3

PostPosted: Sun 25 Jun '06 2:42    Post subject: Similer issues Reply with quote

Hi guys,

I am a total newbi to this, don exactly the same as instructed but when i type the test PHP (on the prower ie:http:/localhost/test.php) or what ever test i have created. it pompts for a file down load of that test.php file. and i cant get the browser to open the PHP file. any ideas what i have done wrong.

cheers
Ibba
Back to top
OldManRiver



Joined: 21 Jun 2006
Posts: 21

PostPosted: Tue 27 Jun '06 21:41    Post subject: Post Reply with quote

Please my post on this at:

http://forums.devshed.com/apache-development-15/apache-error-can-t-load-find-php5apache2-dll-349394.html

Thanks!

OMR
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 27 Jun '06 22:00    Post subject: Reply with quote

You do not have to asociate PHP files in the windows registry. Why should you? there is no need
Back to top
Gottso



Joined: 28 Jun 2006
Posts: 2

PostPosted: Thu 29 Jun '06 1:07    Post subject: Reply with quote

Ok. i made this change in the httpd.conf file, restarted the server and still no dice.

this is highly frustrating Shocked
Back to top


Reply to topic   Topic: Apache starts, but PHP won't do anything View previous topic :: View next topic
Post new topic   Forum Index -> Other Software