The integration of Apache 2.0.35 and PHP 4.3-dev

Source: Internet
Author: User
Tags auth install php include mysql new features parse error php file version
Apache when the Apache 2.0.35 is released in a formal version, it is found that there are few mentions on the network that can successfully integrate Apache 2 and PHP 4. Even the famous forum on the phpbuilder.com is full of negative discussions. I'm the kind of guy who's afraid to be discouraged, working last night until 2:00 am without results, today continues to struggle, from 9:00 to 0:00 from night to the basic idea, but because freelamp.com using the combination of zope+fast_cgi and Apache integration, and Fas The Apache 2 version of t_cgi is still under development, so the current version of the site 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

I use the old--enable-module=most--enable-shared=max to compile, the discovery does not work, Apache 2 will not let the installed modules most, so the use of a long series of options.

Then there's make;make install, and it looks like a success. Modify httpd.conf, the listening port modified to 1234, and then use www.freelamp.com:1234 to see, yes, the traditional version of the Index.html.big out. (How is there no simplified version of our continent?) )

I knew it would be very difficult for PHP to run, so I didn't feel sad about the end of the night when I got there and still had no results. Hopefully, you will soon be able to deploy the combination of Apache 2 and PHP 4. To be honest, to install PHP, you must first find a suitable version, the ready-made latest stable version is not "combined". You have to go to snaps.php.net (this site is a bit slow!) ) to download the php4-latest.tar.bz2 before compiling with the new version. I have used:

./configure--with-apxs2=/apache2/bin/apxs--with-mysql=/usr/local/mysql--with-pgsql=/usr/local/pgsql

To start, but make-time discovery System reports:


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 appears that there is a problem with the parentheses of one of the programs, and that the definition of (long) is used in a macro of Addlong, which seems to be not very related, and is removed from the two lines of 91 and 92. Continue make, Success!
And then, I don't say, you know: Make install.

It's that simple!

However, you need to add the following instructions to httpd.conf to get Apache to know the. php File:

Addoutputfilter php. php
Addinputfilter php. php
AddType text/html. php

Apache 2 Adds a lot of new features that I've covered in previous articles. The connection attached later in this article is useful as an important reference for you to understand the features of Apache 2.0. This site will continue to translate/create about the Apache 2.0 article, as I said in the forum, Apache 2.0 will become an important product, research to enhance the value. The study of Apache 2 will also enhance the value of the site. I believe!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.