# tar zvxf php-5.1.2.tar.gz
# CD php-5.1.2
#./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql--with-apxs2=/usr/local/apache/bin/apxs-- With-libxml-dir=/usr/local/include/libxml2/libxml--WITH-GD--with-zlib
# make
# make Install
#
Note: During the Configure process, you may encounter the following error! Sorry, I cannot run APXS. ***
Sorry, I cannot run APXS. Possible reasons follow:
1. Perl is not installed
2. APXS is not found. Try to pass the path using--WITH-APXS2=/PATH/TO/APXS
3. Apache wasn't built using--enable-so (the APXS usage page is displayed)
Configure:error:Sorry, I cannot run APXS. Either you need to install Perl or need to pass the absolute path of APXS by using--WITH-APXS=/ABSOLUTE/PATH/TO/APXS
There are many ways to introduce solutions on the Internet, but the most classic is only Darrell Brogdon wrote in 2001/03/15 <<installing PHP as an Apache dso>> This article in the Green Union has Xu Yongju in 2002-03-18 translated the Chinese version << on Apache to install PHP>> on the DSO, but I doubt that he is the author of the article.
The reason I say so much is to show that the methods I have seen so far have not been able to really solve the problem.
OK, let me explain how I solved the problem:
First of all, we learned "I cannot run Apxs" through the error message. I always thought it was apxs installation problem, but for a long time still did not get a reasonable explanation and solution.
So I run the "/usr/local/apache/bin/apxs" script directly, get the following error prompt:
BASH:./APXS:/replace/with/path/to/perl/interpreter:bad interpreter:no such file or directory
Oh, it feels like the APXS is still a problem with the program, but where is the problem? What is "interpreter"? Interpreter is "interpreter"!
Well, it seems we are close to the answer, run "head-1/usr/local/apache/bin/apxs" to get the following:
#!/replace/with/path/to/perl/interpreter-w
God, there is no point in the correct Perl execution program! It turns out that this is the real problem!!!
Change this line to "#!/usr/bin/perl-w". Run PHP again configure, everything is OK!
At this point, the problem has been resolved.
PHP installation appears sorry, I cannot run APXS. Error resolution method