Click to See Complete Forum and Search --> : ServerWatch Tutorial: Getting Apache , PHP, MySQL, and phpMyAdmin to Work Together
Amy Newman
07-31-2002, 05:12 PM
Real-World Windows 2000 Configuration: Getting Apache, PHP, MySQL, and phpMyAdmin to Work Together (http://www.serverwatch.com/tutorials/article.php/10825_1437211_1)
This two-part tutorial covers nearly every detail of one writer's quest to install and configure a Web server, server-side scripting language, database, and data administration application on Windows 2000. Part 1 focuses on how to get Apache 1.3.26 with Mod_SSL 2.8.10 and PHP 4.2.2 up and running. Part 2 examines ways to install and configure MySQL and phpMyAdmin on the operating system.
webdevguy1
08-12-2002, 06:37 PM
The link for obtaining Apache 1.3 plus Mod_SSL has changed. The new link is:
http://www.modssl.org/contrib/ftp/contrib/
Currently, the latest file for Windows is the same one mentioned in the article:
Apache_1.3.26-Mod_SSL_2.8.10-OpenSSL_0.9.6d-Win32.zip
When you go to the new page, the link to this file may appear in your browser as:
Apache_1.3.26-Mod_SS..> 24-Jun-2002 18:54 2.1M
- Scott Beatty
Amy Newman
08-15-2002, 02:47 PM
Due to some changes in how the Mod_SSL site handles its downloads, we have made modifications to the tutorial on Page 2 of Part 1 (http://www.serverwatch.com/tutorials/article.php/10825_1437211_2) and in the sidebar titled Creating Your SSL Test Certificate (http://www.serverwatch.com/tutorials/article.php/1437151).
In a nutshell: the link has changed, the required files are spread over two downloads, and a little bit of directory
building is now required.
aaron
09-06-2002, 10:11 AM
Hello,
I have downloaded the appropriate file from modssl.org but when I unzip it I do not have a apache\openssl folder and no ssleay32.dll or libeay32.dll anywhere within the file. Can you clarify/help? Did I miss something in the instructions? The file I downloaded was apache_1.3.26-mod_ssl_2.8.10-openssl_0.9.6d-win32.zip.
thanks
webdevguy1
09-08-2002, 09:26 PM
Please see the post that precedes yours (from Amy Newman, on 08-15-2002). It refers you to p. 2 of part 1 of the article:
http://www.serverwatch.com/tutorials/article.php/10825_1437211_2
That page was updated a few weeks ago. You'll find your answer in the third and fourth paragraphs.
pmears
03-15-2003, 06:35 PM
Even in your updated article, the link for the modssl.org site is no longer valid. Without this link you cannot download Apache_1.3.26-Mod_SSL_2.8.10-OpenSSL_0.9.6d-Win32.zip.
http://www.modssl.org/contrib/ftp/contrib/ points to a folder that no longer exists.
Where else can you download the needed file?
Try this one (best ... tutorial ... evar!) :) ...
http://www.wowwebdesigns.com/power_guides/killer_trio_intro.php
pmears
03-15-2003, 10:32 PM
Great - I cannot wait to try it out - but are there any resources to getting Apache to run SSL on a Win32 box? I would prefer 2.0.x but anything might help.....
Thanks in advance.
webdevguy1
03-15-2003, 11:01 PM
The Windows binaries for Apache with mod_ssl, and openssl, aren't available any longer from the mod_ssl web site. I've been getting them from:
http://hunter.campbus.com/
If someone knows of other sites where they are available on a consistent basis I'd be interested in hearing about them. TIA.
- Scott
Originally posted by pmears
Great - I cannot wait to try it out - but are there any resources to getting Apache to run SSL on a Win32 box? I would prefer 2.0.x but anything might help.....
Thanks in advance.
From the tutorial I linked above, this is 2.0.44 ...
http://www.wowwebdesigns.com/tools/id_28/
stevenwulf
04-23-2003, 03:56 PM
Hey, this an excellent article. I got PHP/APACHE/SSL/MYSQL to work earlier, however I had to piece info together from several articles. This is the first how to that has all the correct information in one place. One problem that this article didn't address, is that apache will work with this configuration, however you do get an error message when you start apache: ."php4apache.dll is compiled as an API, please recompile as EAPI or errors may occur." That's basically what the error message says. I've searched around, and have not been able to find any good tutorials on how to recompile, or compile php under windows from the source code. I have Microsofts visual studio C++. I've downloaded the php source code and tried compling it several times. Everytime the compile fails because of errors. Any information, or know tutorials, on how to compile php or php4apache.dll under windows would be greatly appreciated.
webdevguy1
05-01-2003, 04:03 AM
The message that I've always seen when starting up PHP as an Apache module on Windows 2000 (Win32) says:
[warn] Loaded DSO C:/php/sapi/php4apache.dll uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)
I haven't experienced any crashes, though I sometimes see a message in a pop-up window that Apache had an error, but it keeps on running. I usually only see them during the development of a site. I don't know if those messages are related to this issue.
Generally, I ignore this warning, and things seem to run fine. If someone can come up with a version of the .dll compiled with -DEAPI, I'd like to test it out.
I did some research, and came up with the following:
There is some information about compiling PHP for Windows at:
http://www.phpfreaks.com/phpmanual/page/install.windows.html
but I don't see specific information about -DEAPI.
There is some information about seting -DEAPI in Visual C++ 6 here:
http://www.opensa.org/archive/opensa-devel/msg00017.html
This message:
http://bugs.php.net/bug.php?id=15309
suggests contacting:
php-general@lists.php.net
This message:
http://bugs.php.net/bug.php?id=13893
includes the following comments from sniper@php.net:
(snip)
Not a bug. You need to compile PHP with the apache you're
running it with as the distribution module is not compiled
with Apache that has EAPI enabled.
Or use the CGI instead.
--Jani
(/snip)
The basic information for compiling Apache for Windows is here:
http://httpd.apache.org/docs/win_compiling.html
stevenwulf
05-13-2003, 02:50 PM
Here are the steps I followed to compile php4apahce.dll--as EAPI--under windows. In this case, I'm using Microsoft's--curse them--visual c++ 6.0. The first part of this tutorial is taken directly from the php online manual. So, go to:
http://www.php.net/manual/en/install.windows.php
start at "Building From Source." You'll want to follow these steps verbatum, all the way through "Build reslov.lib." Once you have finished the steps under the "Build resolve.lib" section," you should open Visual C++. Under "File" select "Open workspace." You'll want to open php4ts.dsw, this is located in the win32 folder of you php source. Once the php4ts workspace is loaded, select "projects" -> "settings" from the main menu. Then select the php4apache project in the list. Now click on the "c/c++" tab and you will see the preprocessor definitions. Here you should add "EAPI,"(without the quotes). Now go back to the main menu. Select "Tools" -> "Options." Now click on the "Directories" tab and select "include files" from the drop down menu. You will need to add the path to your apache include directory. Ex: "C:\apache\include" Now select "library files" from the drop down menu. YOu need to add the path to your apache lib directory: "c:\apache\lib" and your apache "libexec" directory "c:\apache\libexec" Now click "ok" and return to the main menu. Go to "Build" and select "active configuration." From the menu select "php4apache-Win32Release_TS" and click "ok" Select "Build" again and then select "Rebuild all." Once the compile has comleted, go to your php source, and look in the Release_TS directory. You should have "php4apache.dll" compiled as an EAPI.
webdevguy1
05-13-2003, 03:39 PM
Steven,
Thanks for posting that build information. As I'm sure you know, it is not commonly known.
Scott
Sojomy
05-19-2003, 02:55 PM
Originally posted by stevenwulf
Last week I finally figured out how to compile php4apache.dll as an EAPI, this eliminates all error messages when you fire apache up. And so far, I've experienced no abnormal behavior with apache or php. I haven't had time to post the proceedure I went through to do the compile, but I hope to have a post up by next week. If you want to try running this .dll, just send me an email and I'll send it to you as an attachment. Email: runner@uclink4.berkeley.edu.
Thanks,
Steven
Steven, I do not have VC++ (like many others). Do you think that you could post that file as an attachment to this thread, or even a link to someplace to download it?
stevenwulf
05-20-2003, 12:14 PM
This .dll was compiled for php 4.2.3 and apache 1.3.27.
SchmoobeeDrew
06-03-2003, 06:39 PM
Glad to have found your site and forum!
I have Apache 1.3.27, PHP 4.3.0, MySQL 3.23.49 running on my Windows 2000 Pro OS.
When Apache was installed on C:/apache as well as C:/openssl C:/mod_SSL
To install Apache with Mod_SSL, first create the directory C:\Apache. Then, extract the files in the Apache_1.3.26-Mod_SSL_2.8.10-OpenSSL_0.9.6d-Win32.zip file, using a program such as WinZip. Place these extracted files in the C:\Apache directory. Then, create a directory C:\Apache\openssl, and a subdirectory, C:\Apache\openssl\bin. Move the config file to C:\Apache\openssl\bin. Next, from the OpenSSL-0.9.6d-Win32.zip file, extract openssl.exe to C:\Apache\openssl\bin, and extract libeay32.dll and ssleay32.dll to C:\WINNT\system32.
I am now trying to do the edits to httpd.conf!
LoadModule ssl_module modules/mod_ssl.so
I do not have this module where do I get it?
Drew
SchmoobeeDrew
06-03-2003, 08:06 PM
configure.bat
i get errors when trying to run it in command prompt
SchmoobeeDrew
06-03-2003, 08:09 PM
when trying to https://localhost
page comes up with
The page cannot be displayed
are the secure files to be in a different folder other than htdocs?
SchmoobeeDrew
06-03-2003, 09:59 PM
My browser recognizes http://localhost/ but not http://127.0.0.1/
I looked in C:\WINNT\system32\drivers\etc\hosts
and the file has:
127.0.0.1 localhost
s_sky_19
02-10-2004, 10:56 AM
Thanks for the great post by stevenwulf. I am not familiar with Microsoft's studio visual c++ and found that when I followed the directions completely, I got this error:
fatal error C1083: Cannot open include file: 'regex.h': No such file or directory
Now click on the "Directories" tab and select "include files" from the drop down menu. You will need to add the path to your apache include directory. Ex: "C:\apache\include"
I also had to add the path to my regex directory. Ex:"C:\WORK\PHP-4.3.4\REGEX"
I have Apache 1.3.29, PHP 4.3.4, MySQL 4.0.17 running on my Windows 2003 Server Standard OS. I have successfully compiled php4apache.dll using Steven's instructions and have attached a copy for anyone who has the same specs. Thanks again.
webdevguy1
04-20-2004, 10:22 AM
mod_ssl requires the Extended API (EAPI) to Apache 1.3 (it is done differently in Apache 2). So, if you want to run PHP as a module to Apache 1.3 along with mod_ssl, and avoid the -DEAPI warning when you start Apache, then you need to build the PHP Apache module (i.e., php4apache.dll) using EAPI.
Thanks to the instructions above which explain how to do that, I built my own EAPI Apache module for PHP 4.3.6. Since I use Turck MMCache, I also built a new mmcache.dll. (Not all .dlls have to be rebuilt with EAPI in order to avoid the -DEAPI warning. I only rebuild the ones that otherwise result in the warning.) The following attachment includes both php4apache.dll and mmcache.dll. I used the PHP 4.3.6 and the MMCache 2.4.6 sources. For Apache, I used the build in Apache_1.3.29-Mod_SSL_2.8.16-Openssl_0.9.7d-Win32.zip from http://hunter.campbus.com/.
For the other Win32 binaries that you might need to run PHP, you can use the precompiled Win32 binaries that come in the file php-4.3.6-Win32.zip from http://www.php.net/. You can also get other Win32 binaries from http://kromann.info/php4.php.
If you plan on using the .dlls in the attached file, then you'll need to use the PHP 4.3.6 binaries and the Apache 1.3.29 mod_ssl build.
***
Notes on building php4apache.dll:
In a previous post, s_sky_19 noted that he needed to add the path to the regex directory (because the compiler needs to be able to find the file regex.h). This works, but you have to remember to update this path if it changes each time you build. Because the file regex.h doesn't change very often, another way to handle this situation, suggested by Steven Wulf, is as follows:
Initially you should have created a "C:\usr" directory. Go into the "usr" directory and create a directory called "include". Then go into your php Win32 source and copy the file "regex.h" into the "usr/include" directory. Now open Visual C++. Open "Tools -> Options". Select the "Directories" tab and select "include" from the drop down list. Now add your new include path to the list: C:\USR\INCLUDE
***
Notes on building mmcache.dll:
In the compiling instructions given at http://turck-mmcache.sourceforge.net/, you can omit the step that says:
- Copy "main/config.w32.h.in" into "main/config.w32.h".
Also, the project file is called mmcache.dsw, not mmcache.dsp.
Like compiling php4apache.dll, add "EAPI," to the beginning of the preprocessor definitions for C/C++ in the project settings.
***
- Scott (author of original article)
bluwulf
07-02-2004, 07:27 PM
I get this error after following the instructions in the article (ServerWatch Tutorial: Getting Apache , PHP, MySQL, and phpMyAdmin to Work Together)
C:\Apache>apache -t
[Fri Jul 02 18:12:01 2004] [warn] Loaded DSO C:/php/sapi/php4apache.dll use
EAPI! (please recompile it with -DEAPI)
Syntax error on line 333 of c:/apache/conf/httpd.conf:
UserDir not allowed here
Note the errors or messages above, and press the <ESC> key to exit. 28...
The line highlighted below is line 333 (the while the line before is line 332 and the line after is line 331...these 3 lines I got from the article)
<Directory "C:/Apache/htdocs">
UserDir "C:/Apache/users/"
DirectoryIndex index.php index.htm index.html
Is there a way to fix this ?
webdevguy1
07-02-2004, 10:37 PM
This really shouldn't be in the config file for this article. My fault. Sorry.
Change the line from:
UserDir "C:/Apache/users/"
to:
UserDir disabled root
bluwulf
07-05-2004, 09:25 AM
Ok....I made the change then I restarted apache now I'm getting this error :
[Mon Jul 05 08:11:55 2004] [warn] Loaded DSO C:/php/sapi/php4apache.dll use
EAPI! (please recompile it with -DEAPI)
Syntax error on line 334 of c:/apache/conf/httpd.conf:
UserDir not allowed here
Note the errors or messages above, and press the <ESC> key to exit. 22...
At line 334 (the line in bold is line 334 the lines before and after represent line 333 and line 335 respectively) this is what I have :
<Directory "C:/Apache/htdocs">
UserDir disabled root
DirectoryIndex index.php index.htm index.html
It must be noted that I haven't installed MySQL as yet (I don't kno if that makes a difference....although according to the tutorial it shouldn't).U have also tried to test whether php is working it isn't (well guess if apache isn't up then php wouldn't be up either.....)
:confused: :confused: :confused: :confused: :confused:
webdevguy1
07-06-2004, 09:41 AM
Are you using the UserDir directive within a <Directory> container in your config file? According to the Apache documentation for the UserDir directive,
http://httpd.apache.org/docs/mod/mod_userdir.html
the context is "server config, virtual host" which, according to:
http://httpd.apache.org/docs/mod/directive-dict.html#Context
means that you can't use UserDir in a <Directory> container.
Please don't be fooled by the way that I presented the config file changes in my article,
http://www.serverwatch.com/tutorials/article.php/10825_1437211_2
Those changes are to be compared to the httpd.default.conf file that comes with Apache (I believe that the one that comes with the current Apache binaries isn't that different from the one I used for the article). It is not a listing of the entire modified config file. Therefore, though the changes include:
<Directory "C:/Apache/htdocs">
UserDir "C:/Apache/users/"
that does not mean that the UserDir statement is included within the <Directory> container.
I apologize for the confusion.
- Scott
bluwulf
07-06-2004, 11:17 AM
I must say that clears up a lot....I thought all I had to do was use the "configuration" in the article (well to atleast get the server up and running with a view of "refining" it later)...thanx anyway !