_php tutorial on compiling problems

Source: Internet
Author: User
This section collects a lot of error situations that can occur at compile time. 1. I use anonymous CVS to get the latest version of the source code package, but no configuration script file! 2. I have a problem configuring PHP to work under Apache. It says it can't find httpd.h, but I think it's right there! 3. When I run conifgure, it says it cannot find the include file or some libraries: GD, GDBM, or some other package! 4. I compile the file language-parser.tab.c, error, hint: Yytname undeclared. 5. When I run make, initially normal but eventually failed, in connection with the last application, there was an error that some files could not be found. 6. In connection with PHP, a bunch of wrong say undefined references. 7. I don't know how to compile PHP under Apache 1.3. 8. I installed the Apache module (under Unix) step by step, but when I opened the PHP script in the browser, it asked me if I wanted to save it. 9. System said use:--activate-module=src/modules/php4/libphp4.a, but that file does not exist, I had to change to--activate-module=src/modules/php4/ libmodphp4.a Well, it's not working anymore! What should I do? 10. I want to compile PHP into an Apache static module, using:--activate-module=src/modules/php4/libphp4.a But the system says my compiler is not ANSI compliant. 11. When I compile PHP with--WITH-APXS, I always get some strange mistakes. 12. At make, I get a lot of microtime errors, and many rusage_ stuff. 13. I would like to upgrade PHP, where can I see the PHP I am now running the original configuration of the installation used by the./configure Line of content? 14. When compiling PHP with the GD library, it does not give some strange mistake, that is, the execution of the Segfaults segment error.
1. I use anonymous CVS to get the latest version of the source code package, but no configuration script file!
You must install the GNU autoconf package so that you can generate a configuration script file from configure.in. Just run on the CVS server to get the source code in the top-level directory of the./buildconf. (Note that unless you run the Configure--enable-maintainer-mode option, the configuration script is not regenerated, even if the configure.in file has been updated, so when you find that configure.in has changed, you also have to do it manually.) A label like @variable@ should be visible in your makefile after the config or config.status is running. )
2. I have a problem configuring PHP to work under Apache. It says it can't find httpd.h, but I think it's right there!
You want to tell configure/setup the location of the top-level directory of Apache scripts. That means you have to mark--with-apache=/path/to/apache, not--with-apache=/path/to/apache/src.
3. When I run conifgure, it says it cannot find the include file or some libraries: GD, GDBM, or some other package!
You can look at the Configure script, the location of those header files or nonstandard libraries, and send some special flags to the C preprocessor. For example: Cppflags=-i/path/to/include ldflags=-l/path/to/library/configure If your shell uses csh-variant, then it will be (why?): env Cppflags=-i/path/to/include ldflags=-l/path/to/library./configure
4. I compile the file language-parser.tab.c, error, hint: Yytname undeclared.
You need to update your Bison version. You can find the latest version in ftp://ftp.gnu.org/pub/gnu/bison/.
5. When I run make, initially normal but eventually failed, in connection with the last application, there was an error that some files could not be found.
Some older versions of make cannot put compiled files in the functions directory in the same directory, try running the CP *.O functions and then run make to see if it will be any better. If so, you should really update your GNU make version.
6. In connection with PHP, a bunch of wrong say undefined references.
Look at the connection lines in the file and make sure all the relevant packages are properly contained. Usually this is because of a lack of '-ldl ' and some database packages you want to support.
If you are connected to Apache 1.2.x, do you remember to add some additional information to the Extra_libs line and re-run the Apache Configure script? See the INSTALL file in the release package.
A lot of people say they get libphp4.a as soon as they increase their '-ldl '.
7. I don't know how to compile PHP under Apache 1.3.
In fact it's very simple, follow the steps below:

Get Apache 1.3 Source code, http://www.apache.org/dist/in the location below.
Extract it in a directory, such as/usr/local/src/apache-1.3.
In PHP's release package directory, compile PHP,./configure--with-apache=/ /apache-1.3 (user's actual apache-1.3 directory location substitution .
Enter: Make then: Make install PHP, copy the necessary files into the Apache directory.
Change to your/ /apache-1.3/src directory, edit the configuration file. Add the following line to the file: Addmodule modules/php4/libphp4.a.
Enter:./configure then: Make.
So you have a httpd file!

Note: You can also use the new Apache./configure script. See the Readme.configure in the release package of course to see the INSTALL file in the PHP release package.
8. I installed the Apache module (under Unix) step by step, but when I opened the PHP script in the browser, it asked me if I wanted to save it.
This means that your PHP module is not loaded. You can check from three points below:

Confirm that you are running the httpd that you have just compiled PHP httpd. Can run:/path/to/binary/httpd-l
If you do not see mod_php4.c listed, then you run an incorrect httpd. It's a good idea to reinstall it.
Confirm that you have added the correct MIME type to the Apache. conf file. It should be like this: AddType application/x-httpd-php3. PHP3 (PHP 3)
or AddType application/x-httpd-php. PHP (PHP 4)
Also ensure that addtype this line is not included in Or block, they will invalidate it.
Finally, the location of the default configuration files for Apache 1.2 and Apache 1.3 is different. You should check the location of the configuration file where you added the AddType line. You can put some obvious errors or changes in httpd.conf so that if the file is read, the system will notify you.

9. System said use:--activate-module=src/modules/php4/libphp4.a, but that file does not exist, I had to change to--activate-module=src/modules/php4/ libmodphp4.a Well, it's not working anymore! What should I do?
Please note that libphp4.a facts do not exist. The Apache process will create it!
10. I want to compile PHP into an Apache static module, using:--activate-module=src/modules/php4/libphp4.a But the system says my compiler is not ANSI compliant.
This error message is Apache misleading and can be corrected with an updated version.
11. When I compile PHP with--WITH-APXS, I always get some strange mistakes.
This situation can be checked from three points. First, for some reason, Apache compiles the Apxs Perl script when it does not create the appropriate flag variable to find your Apxs script (try command which apxs, usually/usr/local/apache/bin/apxs OR/USR/SB In/apxs. Open it to find a line like this: my $CFG _cflags_shlib = "; # substituted via makefile.tmplmy $CFG _ld_shlib = "; # substituted via makefile.tmplmy $CFG _ldflags_shlib = "; # substituted via Makefile.tmpl if that's what you see, then the problem is here. Because the value contains a space or other incorrect value, such as ' Q () '. Turn it into something like this: my $CFG _cflags_shlib = '-fpic-dshared_module '; # substituted via makefile.tmplmy $CFG _ld_shlib = ' gcc '; # substituted via makefile.tmplmy $CFG _ldflags_shlib = q (-shared); # substituted via Makefile.tmpl the second may only appear on red Hat 6.1 and 6.2. APXS Script Red Hat version is wrong. Look at this line: my $CFG _libexecdir = ' modules '; # substituted via Apaci install if you see it, change it to the following line: my $CFG _libexecdir = '/usr/lib/apache '; # substituted via Apaci install third, if you re-configure/Reinstall Apache, you must do so before you make the./configure
12. At make, I get a lot of microtime errors, and many rusage_ stuff.
During the setup process make, if you see the following error: Microtime.c:in function ' php_if_getrusage ': microtime.c:94:storage size of ' USG ' isn ' t KNOWNMICR otime.c:97: ' Rusage_self ' undeclared (first use of this function) microtime.c:97: (Each undeclared identifier is reported O nly oncemicrotime.c:97:for Each function it appears in.) microtime.c:103: ' Rusage_children ' undeclared (first use with this function) make[3]: * * * [Microtime.lo] Error 1make[3]: Leav ing directory '/home/master/php-4.0.1/ext/standard ' make[2]: * * [all-recursive] Error 1make[2]: Leaving directory '/ Home/master/php-4.0.1/ext/standard ' make[1]: * * [all-recursive] Error 1make[1]: Leaving directory '/home/master/ Php-4.0.1/ext ' Make: * * * [all-recursive] Error 1
It's your system that went wrong. You should fix the/usr/include file. The specific procedure is to install the Glibc-devel package that matches your glibc. These errors are absolutely unrelated to PHP, in order to prove that you can do this: $ cat >test.c < x$ gcc-e test.c >/dev/null If something goes wrong, prove that your include file is damaged.
13. I want to upgrade PHP, where can I see the contents of the./configure line that I used when I was running PHP that was originally configured to install it.
You can see the Config.nice file you installed in the PHP source directory. If not, there is another way. You simply run the!--? php phpinfo ();?--> script. On the first line of the output page, the./configure Line, Is the line that you used to configure PHP.
14. When compiling PHP with the GD library, it does not give some strange mistake, that is, the execution of the Segfaults segment error.
You must confirm that you are using the same dependent libraries (such as libpng) when compiling the GD library and PHP.

http://www.bkjia.com/phpjc/314067.html www.bkjia.com true http://www.bkjia.com/phpjc/314067.html techarticle This chapter collects many error situations that can be generated when compiling. 1. I use anonymous CVS to get the latest version of the source code package, but no configuration script file! 2. I am configuring PHP to work under Apache ...

  • 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.