[How-To] Install and test Apache 1.3 & PHP

electron

Administrator
Staff member
How to setup Apache and PHP on Windows 2000/XP

Note: %SystemRoot% is usually c:\winnt for Windows NT/2000 and c:\windows for 95/98/Me/XP

1) Create a directory which will be your root directory. In this example, we will use c:\webroot. This will be the default directory when users go to your domain.

2) Download the latest Apache 1.3 release from http://httpd.apache.org. PHP support for Apache 2.0 is still in its experimental stages, so we are going with version 1.3.



3) Download the latest stable version of PHP from http://www.php.net/downloads.php. Make sure you download the ZIP PACKAGE, DO NOT download the installer!



4) Run the Apache 1.3 installer. Make sure you select 'Run as a service' if you want Apache to start up automatically when your computer boots up. Consult the screenshots below if some of the installation prompts do not make sense.







5) Create the directory c:\php.

6) Extract the contents of the PHP zip file to c:\php.

7) Copy c:\php\php4ts.dll to your %SystemRoot%\System32 directory.

8) Copy c:\php\php.ini-recommended to %SystemRoot%\php.ini.

9) Open %SystemRoot%\php.ini with a text editor.

10) Look for extension_dir = "./" and change it to extension_dir = "c:\php\extensions".

11) By default, you do not need to load any other extensions, but if you eventually want to start generating graphics, I suggest you uncomment ;extension=php_gd2.dll by removing the semicolon.

12) Start > Programs > Apache HTTP Server > Configure Apache HTTP Server > Edit the Apache httpd.conf Configuration File. This should open your default text editor, usually notepad.

ss13.jpg


13) Look for the block of data where you see many LoadModule statements, and add LoadModule php4_module c:/php/sapi/php4apache.dll.



14) Find the block of data where you see many AddModule statements, and add AddModule mod_php4.c.



15) Search for AddType application/x-tar.tgz and add AddType application/x-httpd-php.php on the following line.



16) Look for DocumentRoot, it is probably set to DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs", change it to c:\webroot or whatever directory you created in step 1.

17) Look for DirectoryIndex index.html and add index.php to the end of the line. It should say DirectoryIndex index.html index.php.

17) Restart the Apache service by going to Start > Programs > Apache HTTP Server > Control Apache > Restart.

18) Test your setup by creating a file named index.php in c:\webroot, name it index.php, and add the following line with notepad:
Code:
<?
  phpinfo();
?>

19) Go to http://localhost and you should see a page with information about your PHP configuration.

 

Squintz

Senior Member
Great How-To. Would you mind writing up a sample asp or php status page so that us new guys can have a something to look at when we are trying this out our selfs. Even if its only a few lines of code i would like to know how to poll for the status and send command. I am using z-wave but i think its all the same for x-10 also.
 

electron

Administrator
Staff member
Check out step 18 & 19, shows how to test if it's working. I am working on a seperate 'Interfacing HS with php' tutorial, I just want them seperate since this board isn't just for Homeseer ;)

I got your email notification showing you were having some problems, but I don't see the post, so I assume you deleted it. Do you have it working now?
 

Squintz

Senior Member
Im getting error... Pop up boxes that says.....

Unknown90: Unable to load dynamic library 'c:\apache2\php\extensions\php_bz2.dll' The specified moduel could not be found.

It does this for the entire list of dlls...One pop-up after another. I check and the c:\apache2 directory does not exist.

I followed your tutorial to the t and i went back over and double checked my actions. The apache version i am using is the 1.3.29 exe just like you highlight in the picture

Is there a missing step or should i just create the directory and copy the dlls to it.
 

electron

Administrator
Staff member
where is your php dir located? The how-to shows c:\php but I don't think that's the path you are using. Did you download apache 1.3 or 2.0? Make sure you downloaded the right components, the screenshots show exactly what to do.
 

Squintz

Senior Member
php directory is c:/PHP and yes i did download apache 1.3.29 and php 1.3

A few months back i did download a installer wich included apache2.0 and php 2.0 or whatever the betta versions are. But i did and uninstall on that. Do you think that there is something in my registry pointing to the apache2 folder.
 

Joshua

Member
It looks like it's looking in the wrong directory.

On my system, it's located at: C:\php\extensions

In php.ini on line 442, you should have this:
extension_dir = "C:\php"

What extensions do you have chosen to load, meaning you took out the semi-colon (;) in front of that extension? The only one I have loaded in gd2.dll, because I need gd support for dynamic image creation.
 

Squintz

Senior Member
I have only uncommented the same one as you. I know where all the files are located and they are infact located in the PHP directory that i created. But for some reason its trying to look into the apache2 directory.

Iv searched the config file and the .ini file for apahce2 and came up empty. I think when i get home from work today i am just going to create the directory and copy the dlls to it and see if it works.

"If it's not broken don't try to fix it"
 

electron

Administrator
Staff member
When you uninstalled apache2, did you verify that it was actually gone (including the files on your local HD?) Did you edit the httpd.conf using the instructions posted above? You have to add those lines in those exact locations or you will run in to trouble. PM me your httpd.conf and php.ini (as an attachment) and I can take a look at it if you still can't get it to work.
 

Squintz

Senior Member
I did enter those line in the areas just like in the puctures. I opend up every picture and read every word and performed every task exactly as written. I will PM the files as soon as i get home tonight.

Thanks for trying to help!
 

Squintz

Senior Member
Heres the error log i found while searching for files contating the words c:\apache2\php\extensions

[/CODE]

Failed loading c:\apache2\php\extensions\mmcache.dll
Failed loading c:\apache2\php\extensions\zendoptimizer.dll
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_bz2.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_curl.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_db.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_dba.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_dbase.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_dbx.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_domxml.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_exif.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_fdf.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_gd2.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_gettext.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_interbase.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_iconv.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_java.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_mbstring.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_mcrypt.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_mhash.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_mime_magic.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_pgsql.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_sockets.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_w32api.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_xmlrpc.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_zip.dll' - The specified module could not be found.

in Unknown on line 0
Failed loading c:\apache2\php\extensions\mmcache.dll
Failed loading c:\apache2\php\extensions\zendoptimizer.dll
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_bz2.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_curl.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_db.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_dba.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_dbase.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_dbx.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_domxml.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_exif.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_fdf.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_gd2.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_gettext.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_interbase.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_iconv.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_java.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_mbstring.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_mcrypt.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_mhash.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_mime_magic.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_pgsql.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_sockets.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_w32api.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_xmlrpc.dll' - The specified module could not be found.

in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library 'c:\apache2\php\extensions\php_zip.dll' - The specified module could not be found.

in Unknown on line 0
Code:
 

electron

Administrator
Staff member
somehow apache2 is still involved, where is your apache start/restart/stop shortcut pointing to?
 

Squintz

Senior Member
"C:\Program Files\Apache Group\Apache\Apache.exe" -w -n "Apache" -k restart
"C:\Program Files\Apache Group\Apache\Apache.exe" -w -n "Apache" -k start
"C:\Program Files\Apache Group\Apache\Apache.exe" -w -n "Apache" -k stop

this looks like apache 1.3 to me
 

electron

Administrator
Staff member
I am wondering if you have another copy of php.ini around in one of the directories, do a file search for php.ini and see how many you find.
 

Squintz

Senior Member
Ok two things were wrong but now are fixed thanx to you!

First i did have the php.ini file for apache2 still in c:\WINNT which did not unistall when i removed the Triad installer instalation of Apache which is what i downloaded a few months back.

Second this would have never happend if i had put the php.ini file in the right directory in the first place. I had the correct php.ini file in the c:\ directory and not c:\WINNT if i would have put it in the correct directory then it would have asked me to overwrite the old file.

Thanks its working great now! ill test it in the morning


---------------

OK its about two minutes later and i couldnt wait til morning... Its working fine... I testeed the php part so far
 
Top