PHP installation appears sorry, I cannot run APXS. Error resolution method

Source: Internet
Author: User
Tags install php install perl

# 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&GT;&GT 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

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.