Home  >  Article  >  Backend Development  >  Integration of Apache2.0.35 and PHP4.3-Dev_PHP Tutorial

Integration of Apache2.0.35 and PHP4.3-Dev_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:28:19719browse

When Apache 2.0.35 was released as an official version, I found that there were very few mentions on the Internet of successful integration of Apache 2 and PHP 4. Even the forums on the famous PhpBuilder.com are filled with negative discussions. I'm the kind of guy who doesn't dare to get discouraged. After working until 2:00 AM last night with no results, I continued to work hard today. From 9:00 PM to 0:00 PM, I basically had some ideas. However, because FreeLAMP.com adopted Zope+ The combination of Fast_CGI is integrated with Apache, and the Apache 2 version of Fast_CGI is still under development, so the version currently running on this website is still 1.3.24.

The command to compile Apache is:
./configure --prefix=/apache2 --enable-auth-anon --enable-auth-dbm
--enable-file-cache -- enable-cache --enable-disk-cache --enable-mem-cache
--enable-ext-filter --enable-proxy --enable-proxy-connect --enable-proxy-http
- -enable-http --enable-dav --enable-rewrite --enable-so
When I used the old-fashioned --enable-module=most --enable-shared=max to compile, I found that it didn't work. Apache 2 will not allow most installed modules, so the long list of options above is used.
Then there is make;make install , which seems to be successful. Modify httpd.conf, change the listening port to 1234, and then use www.freelamp.com:1234 to check. Yes, the traditional version of index.html.big is out. (Why is there no simplified version in our mainland?)
I know that it will be very difficult to make PHP run, so I don’t feel sad that I worked very late at night yesterday and still had no results. I hope you who are reading this article can quickly deploy a combination of Apache 2 and PHP 4. To be honest, to install PHP, you must first find a suitable version. The latest stable versions available cannot be "combined". You have to go to snaps.php.net (this site is a bit slow!) and download php4-latest.tar.bz2 before you can compile with the new version. I used:


./configure --with-apxs2=/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-pgsql=/usr/local/pgsql
to start, but the system report was found during make:

00 -I/apache2/include -I/usr/local/src/php4-200204090000/Zend -I/usr/local/mysql/include/ mysql -I/usr/local/pgsql/include -I/usr/local/src/php4-200204090000/ext/xml/expat -D_REENTRANT -I/usr/local/src/php4-200204090000/TSRM -g -O2 - pthread -DZTS -prefer-pic -c /usr/local/src/php4-200204090000/sapi/apache2filter/php_functions.c -o sapi/apache2filter/php_functions.lo
/usr/local/src/php4-200204090000/ sapi/apache2filter/php_functions.c: In function `zif_apache_lookup_uri:
/usr/local/src/php4-200204090000/sapi/apache2filter/php_functions.c:91: parse error before `(
/usr/local/ src/php4-200204090000/sapi/apache2filter/php_functions.c:92: parse error before `(
make: *** [sapi/apache2filter/php_functions.lo] Error 1
[root@www php4-200204090000 ]#
It seems that there is a problem with the brackets in one of the programs. The definition of (long) is used in a macro of ADDLONG. It does not seem to be very relevant. Just put this ( in the two lines 91 and 92. long) was removed. Continue making, success!
Then, even if I don’t say it, you also know: make install.
It’s that simple!
However, you need to add the following instructions to httpd.conf to let Apache recognize the .php file:
AddOutputFilter PHP .php
AddInputFilter PHP .php
AddType text/html .php
Apache 2 adds many new features, which I have introduced in previous articles. The links attached at the end of the article serve as important reference materials and will be helpful for you to understand the features of Apache 2.0. This site will continue to translate/create articles about Apache 2.0. As I said in the forum, Apache 2.0 will become an important product and research will increase its value. Researching Apache 2 will also increase the value of this site. I believe it!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/531777.htmlTechArticleWhen Apache 2.0.35 was released in the official version, it was found that there were few mentions on the Internet about successfully integrating Apache 2 and PHP 4. Even the forums on the famous PhpBuilder.com are filled with negativity...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn