Problem mit IIS 5.1

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
ralphk
Posts: 11
Joined: Fri 28. Nov 2003, 21:50

Post by ralphk »

The variable $_SERVER["DOCUMENT_ROOT"] is not set on my system. It's IIS 5.1 on Win XP por.
Did yout test it on a system with a parallel installation of apache, so that the environmental variable was set by the apache config?

But I just managed to solve the problem by setting the variable myself in 'include/conf_inc/config.inc.php':

Code: Select all

$_SERVER["DOCUMENT_ROOT"]     = "e:/web";
In my case 'e:\web' is the directory und which the phpwcms directory resides.

Thanks to all for the support...
User avatar
Oliver Georgi
Site Admin
Posts: 9945
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Post by Oliver Georgi »

No the one I have send you and tested on (Win2000) has no installed Apache.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
User avatar
Oliver Georgi
Site Admin
Posts: 9945
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Post by Oliver Georgi »

What does your phpinfo(); results in? There are all ENVIRONMENT vars listed.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
ralphk
Posts: 11
Joined: Fri 28. Nov 2003, 21:50

Post by ralphk »

The variable $_SERVER["DOCUMENT_ROOT"] is not even listed. I'll send you (Oliver Georgi) the link to your info@phpwcms.de account. It's a dynamic IP, since the installaion resides on my pc at home...
User avatar
Oliver Georgi
Site Admin
Posts: 9945
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Post by Oliver Georgi »

As I wrote you by email: check if it is possible to install the PHP as ISAPI than as CGI.

That's (the CGI PHP on Windows) something I have not tested.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
ralphk
Posts: 11
Joined: Fri 28. Nov 2003, 21:50

Post by ralphk »

Thanks a lot Oliver. After you observed that my php installation was running as cgi and not as isapi I reconfigured it and ....
Tada ... works great. Thanks a lot
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

ISAP & CGI

Post by pSouper »

Hi Guys,
I've been following this thread as it seems very simmilar to my issues [one lives in hope :lol:]
And now am wondering what CGI & ISAPI and assuming I am configured as CGI how would I test it and reconfigure it to ISAPI [or vasa versa]

any help is greatly appreciated pSouper
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

to pSouper:

I do not have familiarity with IIS but a quick search @ this page http://www.zend.com/manual/install.iis.php showed this:

Code: Select all

Windows NT/2000/XP and IIS 4 or newer
To install PHP on an NT/2000/XP Server running IIS 4 or newer, follow these instructions. You have two options to set up PHP, using the CGI binary (php.exe) or with the ISAPI module. 

In either case, you need to start the Microsoft Management Console (may appear as 'Internet Services Manager', either in your Windows NT 4.0 Option Pack branch or the Control Panel=>Administrative Tools under Windows 2000/XP). Then right click on your Web server node (this will most probably appear as 'Default Web Server'), and select 'Properties'. 

If you want to use the CGI binary, do the following: 


Under 'Home Directory', 'Virtual Directory', or 'Directory', click on the 'Configuration' button, and then enter the App Mappings tab. 

Click Add, and in the Executable box, type: c:\php\php.exe (assuming that you have unziped PHP in c:\php\). 

In the Extension box, type the file name extension you want associated with PHP scripts. Leave 'Method exclusions' blank, and check the Script engine checkbox. You may also like to check the 'check that file exists' box - for a small performance penalty, IIS (or PWS) will check that the script file exists and sort out authentication before firing up php. This means that you will get sensible 404 style error messages instead of cgi errors complaining that php did not output any data. 

You must start over from the previous step for each extension you want associated with PHP scripts. .php and .phtml are common, although .php3 may be required for legacy applications. 

Set up the appropriate security. (This is done in Internet Service Manager), and if your NT Server uses NTFS file system, add execute rights for I_USR_ to the directory that contains php.exe. 


To use the ISAPI module, do the following: 


If you don't want to perform HTTP Authentication using PHP, you can (and should) skip this step. Under ISAPI Filters, add a new ISAPI filter. Use PHP as the filter name, and supply a path to the php4isapi.dll. 

Under 'Home Directory', click on the 'Configuration' button. Add a new entry to the Application Mappings. Use the path to the php4isapi.dll as the Executable, supply .php as the extension, leave Method exclusions blank, and check the Script engine checkbox. 

Stop IIS completely (NET STOP iisadmin) 

Start IIS again (NET START w3svc) 
ralphk
Posts: 11
Joined: Fri 28. Nov 2003, 21:50

Post by ralphk »

You can test it by creating a file 'info.php' with the code:

Code: Select all

<?php 

phpinfo(); 

?>
When you execute the file the third line in your response (Server API) now has the value 'cgi/Fastcgi' or 'isapi'.
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

Hi Guys,
Thanks for the help. I have tried without success to use the ISAPI mode but am getting a plain white page when I try to access any PHP page stating "The specified module could not be found." I realise that this is probably because it can't find a .dll or similar.
PS php works when in cmd i Run php.exe test.php

Code: Select all

<?php 
echo "test" ?>
- but i'm guessing that is because it's not touching the isapi stuff.
by looking at the following things i did would any of you know if I am missing something here?...
To change the mode to ISAPI I...

In IIS... I added 'php4isapi.dll' to the filters in BOTH 'local computer/web sites' & 'local computer/web sites/mywebsite'

I also... changed the .PHP lookup in 'Home directories/configure' in BOTH 'local computer/web sites' & 'local computer/web sites/mywebsite'

I also copied 'php4ts.dll' in to my windows/system32 folder (devshack tip)

Finally In the regestry I changed....

Code: Select all

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map]
".php"="C:\\Program Files\\PHP\\sapi\\php4isapi.dll"
rebooted the server with netstop/start

thanks and any help would be very apreciated. pSouper.

(my underlying problem i think is my [root_directory] as i use exact pathnames for most things but still have some i can't work out where to change them - I'm hoping as there are undoubtedly people who have my HW/SW setup AND have phpwcms working out of the box that I have a IIS/php problem)

my setup is.. winxp pro iis5.x php4.3.4
ralphk
Posts: 11
Joined: Fri 28. Nov 2003, 21:50

Post by ralphk »

Try to use directory names without spaces (e.g. Program Files)...
Good luck
Post Reply