Click to See Complete Forum and Search --> : Install Php4 in Win 98, help !


Anon
07-03-2000, 10:57 AM
I'm new to php, i need a hand to solve my problem :
my email : guitaryou@yahoo.com

Before i explain the problem that i'm facing, let me show you the way that i configure
the php with apache :

Operating System : Win98
Apache : version 1.3.4
PHP : version 4.0.1

Firt of all , i unzip the php file that i downloaded from php.net to the following dir :

C:\Program Files\Apache Group\Apache\cgi-bin


After that i follow the instuctions from the manual i downloaded. I copied
the ini file to windows dir (php.ini-dist tp php.ini) c:\windows

Then i set the root dir and extension-dir like below :

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
include_path = ; UNIX: "/path1:/path2" Windows: "\path1;\path2"
doc_root = C:\Program Files\Apache Group\Apache\htdocs ; the root of the php pages, used only if nonempty
user_dir = ; the directory under which php opens the script using /~username, used only if nonempty
;upload_tmp_dir = ; temporary directory for HTTP uploaded files (will use system default if not specified)
upload_max_filesize = 2097152 ; 2 Meg default limit on file uploads
extension_dir = C:\Program Files\Apache Group\Apache\cgi-bin ; directory in which the loadable extensions (modules) reside
enable_dl = On

OK, that's all for the configuration on php.


* Afterthat, i configure httpd.conf file following :

Although the document i downloaded is version 4 but in the document
it self still explaining the configuration for version 3, that's what
wondered. The instruction from document like below :

ScriptAlias /php3/ "c:/path-to-php-dir/"

AddType application/x-httpd-php3 .php3

AddType application/x-httpd-php3 .phtml

Action application/x-httpd-php3 "/php3/php.exe"


I make changes to :

ScriptAlias /cgi-bin/ "c:/Program Files/Apache Group/Apache/cgi-bin/"

AddType application/x-httpd-php .php

AddType application/x-httpd-php .phtml

Action application/x-httpd-php "/Program Files/Apache Group/Apache/cgi-bin/php.exe"


All x-httpd-php3 i change x-httpd-php since i read those article from website
where they mention no more extension with number in version four, that is
myfile.php3 to myfile.php.

That's all for the configuration on apache web server.



Finally, i run the apache.exe and php.exe :

When i try to run my php, the following error occurs

Fatal error: Unable to open C:\Program Files\Apache Group\Apache\htdocs/me.php in Unknown on line 0


This is the problem i'm facing, although i change everything forward slash,
still couldn't get what i want. please help me !


Thanks for reading my problem and thanks a lot for solving my problem as well.
Thanks you very much.

Michael Email : guitaryou@yahoo.com

Anon
07-03-2000, 06:20 PM
I guess you are executing php.exe from commandline. Here´s how I´m dealing with PHP:

When I installed PHP (and Apache & MySQL) I followed the instructions in the article here on phpbuilder.

After that I´m running the webbrowser connecting to http://localhost/filename.php (localhost is the html base dir specified in Apache, in my case e:\usr\bin\html; that´s where I store my php source).

Any php code that is accessed through Apache (localhost) is parsed by php.exe and the output is handled by the browser.

Hope this was to some help.
/Niclas

Anon
07-03-2000, 11:40 PM
When i run php.exe , and black screen
pop up, it's contain words on the screen ??

i mean like the apache, when i run, it will show apache is running and some other words.

Anon
07-04-2000, 04:18 PM
Hey ..

U don't have to run php.exe directly. Just start Apache and leave it running. Then open U'r browser and type http://name of U'r server or http://localhost and see if Apache is working. Save U'r php script file in the document root directory of Apache (htdocs by default). Request it from the browser by typing http://localhost/<filename.php>

This should work ..

Anon
07-05-2000, 01:09 AM
From the document :

ScriptAlias /php3/ "c:/path-to-php-dir/"

AddType application/x-httpd-php3 .php3

AddType application/x-httpd-php3 .phtml

Action application/x-httpd-php3 "/php3/php.exe"


I make changes to :

ScriptAlias /cgi-bin/ "c:/Program Files/Apache Group/Apache/cgi-bin/"

AddType application/x-httpd-php .php

AddType application/x-httpd-php .phtml

Action application/x-httpd-php "/Program Files/Apache Group/Apache/cgi-bin/php.exe"


May i know the changes to the httpd.conf is correct or not ? or i shound't remove the 3 ?

Anon
08-22-2000, 07:41 AM
Try this one (I assume you for some reason have installed php in your cgi-bin.):

ScriptAlias /php/ "c:/Program Files/Apache Group/Apache/cgi-bin/"

AddType application/x-httpd-php .php

AddType application/x-httpd-php .phtml

Action application/x-httpd-php "/php/php.exe"

The "path-stuff" before php.exe on the Action line is refering to the name of the Alias you specified on the ScriptAlias line. In this case /php/ which is an alias for "c:/Program Files/Apache Group/Apache/cgi-bin/".