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: PHP pages just aren't loading Page 1, 2  Next
Author
RagingFerret



Joined: 01 Jun 2006
Posts: 9

PostPosted: Sat 10 Jun '06 6:33    Post subject: PHP pages just aren't loading Reply with quote

Okay, so I installed Apache 2.2 and PHP 5.2 dev. Both are sitting on drive G (long story) and I've followed every guide on this and every website I can find. I edited my httpd.conf file as follows:

# For PHP 5 do something like this:
LoadModule php5_module "g:/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php

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

and I copied php5apache2_2.dll to windows/system, windows, and windows/system32 (along with php.ini). Still no luck. I'm taking any suggestions.
Thanks guys.
Back to top
phelum



Joined: 10 Jun 2006
Posts: 5

PostPosted: Sat 10 Jun '06 10:42    Post subject: Re: PHP pages just aren't loading Reply with quote

RagingFerret wrote:
Okay, so I installed Apache 2.2 and PHP 5.2 dev.

For PHP 5 do something like this:
LoadModule php5_module "g:/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php

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

and I copied php5apache2_2.dll to windows/system, windows, and windows/system32 (along with php.ini). Still no luck. I'm taking any suggestions.
Thanks guys.


I am running NT4 and had to add the PHP path (e.g. "g:\PHP" in your case) to my PATH environment variable to get it to work. I didn't copy the DLL to my WINNT directories.

Also, check the apache and php error.log files for clues.

-- Steven
Back to top
RagingFerret



Joined: 01 Jun 2006
Posts: 9

PostPosted: Sat 10 Jun '06 16:42    Post subject: Re: PHP pages just aren't loading Reply with quote

phelum wrote:
RagingFerret wrote:
Okay, so I installed Apache 2.2 and PHP 5.2 dev.

For PHP 5 do something like this:
LoadModule php5_module "g:/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php

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

and I copied php5apache2_2.dll to windows/system, windows, and windows/system32 (along with php.ini). Still no luck. I'm taking any suggestions.
Thanks guys.


I am running NT4 and had to add the PHP path (e.g. "g:\PHP" in your case) to my PATH environment variable to get it to work. I didn't copy the DLL to my WINNT directories.

Also, check the apache and php error.log files for clues.

-- Steven


Ah, only problem is, I'm stupid and don't know HOW to add my PHP directory to my path environment (is this within one of the config files?).
Gah, I apologize in advance for being stupid.
Back to top
phelum



Joined: 10 Jun 2006
Posts: 5

PostPosted: Sat 10 Jun '06 23:36    Post subject: Re: PHP pages just aren't loading Reply with quote

RagingFerret wrote:
Ah, only problem is, I'm stupid and don't know HOW to add my PHP directory to my path environment (is this within one of the config files?).


What version of Windows are you using ? PATH is normally accessed by right-clicking My Computer, then Properties, then Environment, then selecting PATH and appending ";g:\php" to whatever is already there.

Firstly, have you checked the error logs yet ? There might be some info in apache2\logs\error.log or php\error.log.

-- Steven
Back to top
RagingFerret



Joined: 01 Jun 2006
Posts: 9

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

Hi, I'm using Windows XP and I'm looking at the path stuff now. So far
there are two variables, one for temp and one for tmp (I'm guessing I just append to one of these?) along with some system variables. Guessing I add the G:\php in there somewhere?
Also, I know this is just ONE method of adding PHP to the system. I've got the ini and dll files on my system in the appropriate places...if that's not working should I be alarmed?
Back to top
phelum



Joined: 10 Jun 2006
Posts: 5

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

RagingFerret wrote:
Hi, I'm using Windows XP and I'm looking at the path stuff now. So far
there are two variables, one for temp and one for tmp (I'm guessing I just append to one of these?) along with some system variables. Guessing I add the G:\php in there somewhere?


PATH is in the System Variables. You should append a ';' then 'g:\php' to make the change. You will probably have to reboot after.

But, have you checked the error logs yet ? If there is a problem starting PHP (when Apache starts or is restarted) it will be recorded in the apache error.log. If there is a script error there should be a line in the php\error.log. PHP syntax errors normally result in an empty response to the browser when you request the php page.

-- Steven
Back to top
Siron



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

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

I seem to be having the same problem. Apache 2.2.2 + PHP 5.1.4 on Windows XP with SP2. I put all the necessary things in the Apache config:

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"


I have applied the new handler which I downloaded at this site, as well as the .NET framework. When I load up php pages it just shows the source code. There have been no error messages from Apache or PHP.. I've even tried putting the config in C:\Windows, tried setting the PATH in Environment variables.. nothing seems to be working.
Back to top
phelum



Joined: 10 Jun 2006
Posts: 5

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

Siron wrote:
I seem to be having the same problem. Apache 2.2.2 + PHP 5.1.4 on Windows XP with SP2.


I'm running 2.0.58 rather than 2.2.2 (from Steffen) but I doubt there is a problem with 2.2.2 or there would be many posts about it.

Did you have PHP running with a previous version of Apache ? If not, there might be a problem with the PHP.INI file. I am offsite so I can't check mine but there were some path entries in the file that I had to fix manually.

If you get PHP files delivered as text it sounds like the AddType is being ignored or overridden.

-- Steven
Back to top
RagingFerret



Joined: 01 Jun 2006
Posts: 9

PostPosted: Tue 13 Jun '06 5:41    Post subject: Reply with quote

Siron wrote:
I seem to be having the same problem. Apache 2.2.2 + PHP 5.1.4 on Windows XP with SP2. I put all the necessary things in the Apache config:

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"


I have applied the new handler which I downloaded at this site, as well as the .NET framework. When I load up php pages it just shows the source code. There have been no error messages from Apache or PHP.. I've even tried putting the config in C:\Windows, tried setting the PATH in Environment variables.. nothing seems to be working.



Yeah, I checked the apache error log the first time I had these problems, and didn't see anything that helped at all. There is no error log in my PHP folder, so I'm guessing none have been generated. This is my second install of PHP/Apache and I don't remember adding anything to my path last time (my first install of apache is still resident on another hard drive on this system...wonder if that's affecting it?) and it worked fine. Also, I doubt it's a syntax error in my code since I filled a MySQL database using this code and I loaded some "hello world" style code I've written...
Hmm...
Could it be because I have installed apache in "program files"? or maybe because apache/php are on drive "G" rather than "C"? Maybe because i'm using apache 2.2 and that weird developemnt version of PHP that is recommended on php.net? Or maybe it's 'cause I have apache/php installed on another drive (they shouldn't be loading though).
Back to top
RagingFerret



Joined: 01 Jun 2006
Posts: 9

PostPosted: Wed 14 Jun '06 6:45    Post subject: Reply with quote

Okay, I've been working on this and decided to reinstall everything. I reinstalled apache 2.2 and PHP 5.14. Now, when I edit my http.conf file, Apache won't restart! The error log (/Apache/logs/error.log) file doesn't show anything of interest either...I'm using THIS in my file (right under the rest of the "LoadModule" lines...


# For PHP 5 do something like this:
LoadModule php5_module "G:/php/php5apache2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "G:/php/"

With those lines commented out, I can start apache just fine. Anyone see some grevious error? I copied php5ts.dll to windows and windows/system.

Thanks guys.
Back to top
Steffen
Moderator


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

PostPosted: Wed 14 Jun '06 12:51    Post subject: Reply with quote

Do you use the php5apache2.dll for here ?

Steffen
Back to top
seinstein



Joined: 02 May 2006
Posts: 4
Location: Dublin, Ireland

PostPosted: Wed 14 Jun '06 19:19    Post subject: Apache, PHP, MySQL, phpMyAdmin and more to come - integrated Reply with quote

Hi guys, see you are all having problems with setting up your servers. Well, I have spent many a night on making this program called 'EasyWeb Server' and it has all the ingredients you'd want, namely the latest versions of Apache, PHP, MySQL etc. - plus it is extremely easy to add your own modules etc. There is an included documentation (which will be added to on request), and I am just about to release the SSL version.

Get it here:

http://easywebserver.sytes.net/.

The Sourceforge section will be updated when I have built the Apache+SSL installer.

Enjoy! Laughing
Back to top
Siron



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

PostPosted: Thu 15 Jun '06 20:57    Post subject: Reply with quote

I somehow managed to get PHP working, well sort of. I guess I'll have to mess around with the php.ini file now becuase phpinfo() is like the only thing that works lol.
Back to top
RagingFerret



Joined: 01 Jun 2006
Posts: 9

PostPosted: Fri 16 Jun '06 4:51    Post subject: Reply with quote

I don't wanna take an easier route because I HAVE done this before, it just doesn't wanna work now for reasons that are beyond me...Seriously, what AM I doing wrong here? Why do these lines prevent me from starting the apache service?


# For PHP 5 do something like this:
LoadModule php5_module "g:/php/php5apache2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "g:/php/"

Are these not DIRECT copies (with changes to my actual path) of what's on php.net? This is getting a tad frustrating since I have no clue as to what I'm doing wrong here.
Back to top
doodah



Joined: 17 Jun 2006
Posts: 1

PostPosted: Sat 17 Jun '06 2:15    Post subject: Reply with quote

admin Site Admin

PostPosted: Mon May 29, 2006 8:11 pm Post subject: Apache 2.2 with PHP5.1 -- Cannot load php5apache2.dll Reply with quote
Quote:

httpd.exe: Syntax error on line # of .../conf/httpd.conf: Cannot load
.../php5apache2.dll into server: Cannot find the module.

The official releases of PHP 5.1.x are built/compiled against the Apache 2.0 codebase, not Apache 2.2 -- and this is the problem...

http://www.apache.org/dist/httpd/Announcement2.2.html
Quote:

This release has been through extensive testing, including live at some of the world's busiest sites, and is now considered stable. This means that modules and applications developed for Apache 2.2.2 will be both source- and binary-compatible with future 2.2.x releases. This release builds on and extends the Apache 2.0 API. Modules written for Apache 2.0 will need to be recompiled in order to run with Apache 2.2, but no substantial reworking should be necessary.

There are two ways around this problem...

1) Build PHP 5.1.x yourself against Apache 2.2 codebase.

http://www.php.net/manual/en/install.windows.building.php

2) Use PHP 5.2 / php5apache2_2.dll instead...

Download php5.2-win32-latest.zip from http://snaps.php.net/
Use...
Code:
LoadModule php5_module .../php5/php5apache2_2.dll


(I suppose you can also just copy php5apache2_2.dll from snapshot PHP5.2 to your PHP5.1 directory -- instead of using the unreleased PHP5.2 canidate)

Last edited by admin on Tue Jun 06, 2006 1:35 am; edited 1 time in total

Found this on another site and it seemed to solve my problem too (I'm using win98 for learning purposes). It's too bad php's web site doesn't say anything about this... Sad
Back to top
RagingFerret



Joined: 01 Jun 2006
Posts: 9

PostPosted: Tue 20 Jun '06 6:38    Post subject: Reply with quote

doodah wrote:
admin Site Admin

PostPosted: Mon May 29, 2006 8:11 pm Post subject: Apache 2.2 with PHP5.1 -- Cannot load php5apache2.dll Reply with quote
Quote:

httpd.exe: Syntax error on line # of .../conf/httpd.conf: Cannot load
.../php5apache2.dll into server: Cannot find the module.

The official releases of PHP 5.1.x are built/compiled against the Apache 2.0 codebase, not Apache 2.2 -- and this is the problem...

http://www.apache.org/dist/httpd/Announcement2.2.html
Quote:

This release has been through extensive testing, including live at some of the world's busiest sites, and is now considered stable. This means that modules and applications developed for Apache 2.2.2 will be both source- and binary-compatible with future 2.2.x releases. This release builds on and extends the Apache 2.0 API. Modules written for Apache 2.0 will need to be recompiled in order to run with Apache 2.2, but no substantial reworking should be necessary.

There are two ways around this problem...

1) Build PHP 5.1.x yourself against Apache 2.2 codebase.

http://www.php.net/manual/en/install.windows.building.php

2) Use PHP 5.2 / php5apache2_2.dll instead...

Download php5.2-win32-latest.zip from http://snaps.php.net/
Use...
Code:
LoadModule php5_module .../php5/php5apache2_2.dll


(I suppose you can also just copy php5apache2_2.dll from snapshot PHP5.2 to your PHP5.1 directory -- instead of using the unreleased PHP5.2 canidate)

Last edited by admin on Tue Jun 06, 2006 1:35 am; edited 1 time in total

Found this on another site and it seemed to solve my problem too (I'm using win98 for learning purposes). It's too bad php's web site doesn't say anything about this... Sad


I must be stupid or something 'cause even THIS isn't working. I tried this method once before and got the same results as those I'm getting now. Basically, my steps are as follows (please tell me if I'm making a wrong turn here somewhere)
DL PHP 5.2 from the snapshots page
Extract the content from the zip file and copy over to G:/php
Edit php.ini-recommended to php.ini (don't edit this file as it ain't totally necessary)
Copy php5ts.dll to windows and windows/sytem
Edit httpd.conf to this:
# For PHP 5 do something like this:
LoadModule php5_module "G:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "G:/php/"

PHP pages still aren't showing up. This is after a browser cleansing (cookies/history, etc) and restarting apache a few times...There's gotta be something small and simple that I'm missing.
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Tue 20 Jun '06 9:43    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.

Beyond this, I don't know what to tell you except that I'm using PHP 5.1.4 downloaded from PHP.net in conjunction with Steffen's php5apache2.dll. Also, in the PHP.INI file set error_reporting = E_ALL and display_errors = On until you have PHP working.

Good Luck
..
Back to top
tricky



Joined: 05 Jul 2006
Posts: 2

PostPosted: Wed 05 Jul '06 15:24    Post subject: Reply with quote

I have been struggling and don't have php 5.1.4 reading the dll files yet in 'ext' but php does load with Apache 2.2.2 for me with these settings:

#In httpd.conf (taken from snapshots 5.2.0-dev)
LoadModule php5_module "C:/php-5.1.4-Win32/php5apache2_2.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php-5.1.4-Win32"

Good Luck
Back to top
madman



Joined: 17 Jul 2006
Posts: 1

PostPosted: Mon 17 Jul '06 10:15    Post subject: working of PHP on apache 2.2 Reply with quote

Hi I am new to apache and php and spent two nights trying to fix working of php on apache 2.2. I could make it work and so providng you the solution below.

1. Official stable release from php wont work with apache 2.2 as it requires php5apache2_2.dll and not php5apache2.dll. So, go to http://snaps.php.net/ and download the latest day-wise build. Install it and rename php.ini-dist to php.ini

2. In php.ini, though you are free to modify as much as you want but to make it work, just set doc_root to the the directory which is set as documentroot in httpd.conf.

3. Open httpd.conf and add the following below LoadModule series, make sure you change C:/php by the directory/path in which you installed php.
# PHP 5 Module
LoadModule php5_module "c:/php/php5apache2_2.dll"
# configure the path to php.ini
PHPIniDir "C:/php"

Add

AddType application/x-httpd-php .php

in <if mime_module> </ifmodule>

Usually all of us have been adding this alongwith loadmodule and thats the problem.

Hope this solves your problem.

MadMan
newsofuse@gmail.com
Back to top
tricky



Joined: 05 Jul 2006
Posts: 2

PostPosted: Mon 17 Jul '06 10:27    Post subject: Re: working of PHP on apache 2.2 Reply with quote

Mad.. (I should have chosen that name) thanks for your help but I struck gold by getting something from a crew called xampp. You can download an almost ready configured trio (in my case) of Apache, PHP and mySQL. After a bit I had a system that even worked.

Now my problem is trying to understand Javascript - I can't seem to find a good web source to even explain the parameters passed to a common function.

Cheers again - Tricky, isn't it? Confused
Back to top


Reply to topic   Topic: PHP pages just aren't loading View previous topic :: View next topic
Post new topic   Forum Index -> Other Software Page 1, 2  Next