PHP compilation problems. 1. I use anonymous CVS to get the latest source code package, but no script file is configured! You must install the GNUautoconf package to generate the configuration script file from configure. in. 1. I use anonymous CVS to get the latest source code package, but no script file is configured!
You must install the GNU autoconf package so that the configuration script file can be generated from configure. in, as long as the./buildconf file runs in the top-level Directory of the source code obtained by the CVS server. (Note: Unless you run the configure -- enable-maintainer-mode option, the configuration script will not be regenerated, even if configure. the in file has been updated, so when you find configure. in has changed, and you have to do it manually. in config or config. after status is run, you should see a number like @ VARIABLE @ in your Makefile .)
2. I encountered a problem when configuring PHP to work in Apache. It says it cannot find httpd. h, but I think it's there!
Tell configure/setup script the location of Apache's top-level Directory. That is to say, you need to mark -- with-apache =/path/to/apache, instead of -- 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 packages!
You can check the configure script, the header file or non-standard library location, to send some special signs to the C preprocessor. 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. An error occurred while compiling the file language-parser.tab.c with the prompt: yytname undeclared.
You need to update your Bison version. you can find the latest version at ftp://ftp.gnu.org/pub/gnu/bison.
5. when I run make, it is normal at first, but eventually fails. when I connect to the final application, an error occurs, indicating that some files cannot be found.
Some old versions of make cannot put the compiled files under the functions directory into the same directory, and try to run cp *. o functions and then run make to see if it is better. If so, you should update your GNU Make version.
6. when connecting to PHP, a bunch of errors are reported: undefined references.
Check the connection lines in the file to make sure all related packages are correctly included. This is usually because '-ld' is missing and there are some database packages you want to support.
If you are connecting to Apache 1.2.x, do you remember to add some additional information in the EXTRA_LIBS line and re-run the Apache's Configure script? See the INSTALL file in the release package.
Many people say that when they add '-ld', they will immediately get libphp4.a.
7. I don't know how to compile PHP in Apache 1.3.
In fact, it is very simple. follow these steps:
Get Apache 1.3 source code, http://www.apache.org/dist/ in the following position.
Decompress the package in a directory, such as/usr/local/src/apache-1.3.
Compile PHP,./configure -- with-apache =/under the PHP release package directory/ /Apache-1.3 (replaced by the actual apache-1.3 Directory location) .
Run: make and then: make install to compile PHP and copy the required files to the Apache Directory.
Change to your/ /Apache-1.3/src Directory, edit the Configuration file. add the following lines to the File: AddModule modules/php4/libphp4.a.
Input:./Configure and then: make.
In this way, you have an httpd file!
Note: You can also use the new Apache./configure script. See README. configure in the release package and check the INSTALL file in the PHP release package.
8. I installed the Apache module step by step (under Unix), but when I opened the PHP script in a browser, it asked me if I wanted to save it.
This means that your PHP module is not loaded. You can check from the following three points:
Make sure that the Httpd you run is the Httpd you just compiled for PHP. you can run:/path/to/binary/httpd-l.
If you do not see the mod_php4.c column, you have run the incorrect Httpd. you 'd better reinstall it.
Make sure 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)
Make sure that the AddType row is not included in Or Block, they will make it invalid.
Finally, the default configuration files of Apache 1.2 and Apache 1.3 are located differently. you should check the location of the configuration file with AddType added. you can go to httpd. conf put some obvious errors or changes, so that if the file is read, the system will notify you.
9. the system uses -- activate-module = src/modules/php4/libphp4.a, but the file does not exist. I have to change it to -- activate-module = src/modules/php4/libmodphp4.a, it does not work anymore! What should I do?
Please note that libphp4.a does not exist. The apache process will create it!
10. I want to compile PHP into a static module of Apache and use -- activate-module = src/modules/php4/libphp4.a. However, the system says that my compiler is not ANSI compatible.
This error message is misled by Apache and can be corrected by updating the version.
11. when I use -- with-apxs to compile PHP, I always get some strange errors.
In this case, you can check from three points. first, for some reason, when Apache compiles the apxs Perl script, it does not create an appropriate flag variable and finds your apxs script (try the command which apxs, usually in/usr/local/apache/bin/apxs or/usr/sbin/apxs. open it and find the following line: my $ export _cflags_shlib = ''; # substituted via Makefile. tmplmy $ export _ld_shlib = ''; # substituted via Makefile. tmplmy $ export _ldflags_shlib = ''; # substituted via Makefile. tmpl
If you see this, the problem lies here. because the value contains spaces or other incorrect values, such as 'Q ()'. change it like the following: my $ export _cflags_shlib = '-fpic-DSHARED_MODULE'; # substituted via Makefile. tmplmy $ export _ld_shlib = 'gcc '; # substituted via Makefile. tmplmy $ export _ldflags_shlib = q (-shared); # substituted via Makefile. tmpl
Second, it may only occur on Red Hat 6.1 and 6.2. The Red Hat version of apxs script is incorrect. see this line: my $ export _libexecdir = 'Les Le'; # substituted via APACI install
If you see it, change it to the following line: my $ export _libexecdir = '/usr/lib/Apache'; # substituted via APACI install
Third, if you re-configure or reinstall Apache, you must execute make clean after./configure and before make.
12. During make, I got a lot of errors about microtime and a lot of RUSAGE _ stuff.
During the installation of make, if you see the following error: microtime. c: In function 'php _ if_getrusage': microtime. c: 94: storage size of 'usg' isn' t knownmicrotime. c: 97: 'rusage _ SELF 'undeclared (first use in this function) microtime. c: 97: (Each undeclared identifier is reported only oncemicrotime. c: 97: for each function it appears in .) microtime. c: 103: 'rusage _ CHILDREN 'undeclared (first use in this function) make [3]: *** [microtime. lo] Error 1 make [3]: Leaving directory '/home/master/php-4.0.1/ext/standard' make [2]: * ** [all-recursive] Error 1 make [2]: Leaving directory '/home/master/php-4.0.1/ext/standard' make [1]: * ** [all-recursive] Error 1 make [1]: Leaving directory '/home/master/php-4.0.1/ext' make: *** [all-recursive] Error 1
That's your system error. you should fix the/usr/include file. install the glibc-devel package that matches your glibc. these errors are definitely irrelevant to PHP. to prove this, you can do this: $ cat> test. c < X $ gcc-E test. c>/dev/null
If an error occurs, it indicates that your inclusion file is damaged.
13. I want to upgrade PHP. Where can I see the./configure line used for the initial configuration and installation of php I am running .?
You can see that you install the config. nice file in the PHP source directory. if not, there is another method. you just need to simply run
Script. The first line on the output page is the./configure line, which is the line you used to configure PHP.
14. when compiling PHP with GD library, it does not give some strange errors, or it produces segfaults errors during execution.
Make sure that you use the same dependent libraries (such as libpng) when compiling the GD library and PHP ).
Http://www.bkjia.com/PHPjc/446900.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/446900.htmlTechArticle1. I use anonymous CVS to get the latest version of the source code package, but there is no configuration script file! You must install the GNU autoconf package to generate the configuration script file from configure. in...