Compilation Problem_PHP Tutorial
This chapter collects many error conditions that may occur during compilation. 1. I used anonymous CVS to get the latest version of the source code package, but there was no configuration script file! 2. I had a problem when configuring PHP to work under Apache. It said it couldn't find httpd.h, but I saw it was there! 3. When I ran conifgure, it said it couldn't find the include file or some library: GD, gdbm, or some other package! 4. I was compiling When trying to file language-parser.tab.c, an error occurred, prompting: yytname undeclared. 5. When I ran make, it worked fine at first but failed in the end. When connecting to the final application, an error occurred saying that some files could not be found. 6. When connecting to PHP, a bunch of errors saying undefined references occurred. 7. I don't know how to compile PHP under Apache 1.3. 8. I installed the Apache module (under Unix) according to the steps step by step, but when I opened the PHP script in the browser, it asked me if I wanted to save it. 9. The system said to use: --activate-module=src/modules/php4/libphp4.a, but the file did not exist at all, so I had to change it to --activate-module=src/modules/php4/libmodphp4.a. , it doesn’t work! What should I do? 10. I want to compile PHP into a static module of Apache, use: --activate-module=src/modules/php4/libphp4.a but the system says that my compiler is not ANSI compatible of. 11. When I compile PHP with --with-apxs, I always get some strange errors. 12. When making, I get a lot of errors about microtime, and a lot of RUSAGE_ stuff. 13. I want to upgrade PHP, where can I see the ./configure line that I used to configure and install the PHP I am running now? Content? 14. When compiling PHP with GD library, it either gives some strange errors or generates segfaults during execution.
1. I used 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 so that the configuration script file can be generated from configure.in. Just run ./buildconf in the top-level directory of the CVS server to get the source code. (Note, unless you run configure with the --enable-maintainer-mode option, the configure script will not be regenerated even if the configure.in file has been updated, so when you find that configure.in has changed, you will have to do it manually. In After running config or config.status, you should see labels like @VARIABLE@ in your Makefile. )
2. I had a problem when configuring PHP to work under Apache. It says it can't find httpd.h, but I see it's there!
You need to tell the configure/setup script the location of Apache's top-level directory. That means you have to specify --with-apache=/path/to/apache, not --with-apache=/path/to/apache/src.
3. When I run conifgure, it says it can't Find the include file or some libraries: GD, gdbm, or some other packages!
You can look at the configure script to see the location of those header files or non-standard libraries. You need to 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. When I compiled the file language-parser.tab.c, an error occurred, prompting: 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 works fine at first but eventually fails, When connecting to the final application, an error occurred saying some files could not be found.
Some old versions of make cannot put the compiled files in the functions directory into the same directory. Try running cp *.o functions and then run make to see if it will be better. If so, you really should update your version of GNU Make.
6. When connecting to PHP, a bunch of errors say undefined references.
Look at the link line in the file to confirm that all relevant packages have been included correctly. Usually this is because '-ldl' 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 extra information in the EXTRA_LIBS line and rerun Apache's Configure script? See the INSTALL file in the distribution package.
Many people said that they got libphp4.a as soon as they added '-ldl'.
7. I don’t know how to compile PHP under Apache 1.3.
It's actually very simple, follow these steps:
Get the Apache 1.3 source code at the following location: http://www.apache.org/dist/.
Extract it in a directory, such as /usr/local/src/apache-1.3.
In the PHP distribution package directory, compile PHP, ./configure --with-apache=/
Type: make and then: make install to compile PHP and copy the necessary files to the Apache directory.
Change to your /
Type: ./Configure and then: make.
This way you have an httpd file!
Note: You can also use the new Apache ./configure script. See README.configure in the distribution package and of course also look at the PHP distribution package. INSTALL file.
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 your PHP module is not loaded. You can check from the following three points:
Confirm that the Httpd you are running is the Httpd you just compiled PHP. You can run: /path/to/binary/httpd -l
If you don’t see it mod_php4.c is listed, then you are running an incorrect Httpd. It is best to reinstall it.
Make sure you add the correct Mime type in the Apache .conf file. It should look like this: AddType application/x-httpd-php3 .php3 (PHP 3)
or AddType application/x-httpd-php . php (PHP 4)
Also ensure that the AddType line is not included in a
Finally, the location of the default configuration file is different between Apache 1.2 and Apache 1.3. 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 If this file is read, the system will notify you.
9. The system said to use: --activate-module=src/modules/php4/libphp4.a, but the file did not exist at all, so I had to change it to --activate-module=src/modules/php4 /libmodphp4.a Ok, it doesn’t work! What to 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 for Apache , use: --activate-module=src/modules/php4/libphp4.a but the system says that my compiler is not ANSI compatible.
This error message is misleading by Apache and can be fixed with a newer version.
11. When I compile PHP with --with-apxs, I always get some strange errors.
When this happens, you can check from three points. First, for some reason, Apache did not create the appropriate flag variable when compiling the apxs Perl script. Find your apxs script (try the command which apxs , usually in /usr/local/apache/bin/apxs or /usr/sbin/apxs. Open it and find a line like the following:
my $CFG_CFLAGS_SHLIB = ' '; ; # substituted via Makefile.tmplmy $CFG_LD_SHLIB = ' '; in Here. Because the value contains spaces or other incorrect values, such as 'q()'. Change it to like the following:
my $CFG_CFLAGS_SHLIB = '-fpic -DSHARED_MODULE'; # substituted via Makefile.tmplmy $CFG_LD_SHLIB = 'gcc'; # substituted via Makefile.tmpl The second possibility is just Appears on Red Hat 6.1 and 6.2. The apxs script Red Hat version has an error. 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 reconfigure/reinstall Apache, you must execute make clean
12. after ./configure and before make. When making, I get a lot of errors about microtime, and a lot of RUSAGE_ stuff.
When making during the installation process, 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 1make[3]: Leaving 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
That is an error on your system. You should repair the /usr/include file. The specific method is to install the glibc-devel package that matches your glibc. These errors have nothing to do with PHP. Proof, you can do this:
$ cat >test.c << >13. I want to upgrade PHP. Where can I see the content of the ./configure line that I used to configure and install the PHP I am running now?
You can look at the config in the source directory where you installed PHP. nice file. If that doesn't work there is another way. You can 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 the GD library , it either gives some strange errors, or generates segfaults during execution.
You must confirm that you use the same dependent library (such as libpng) when compiling the GD library and PHP.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



If you encounter an error message when using your printer, such as the operation could not be completed (error 0x00000771), it may be because the printer has been disconnected. In this case, you can solve the problem through the following methods. In this article, we will discuss how to fix this issue on Windows 11/10 PC. The entire error message says: The operation could not be completed (error 0x0000771). The specified printer has been deleted. Fix 0x00000771 Printer Error on Windows PC To fix Printer Error the operation could not be completed (Error 0x0000771), the specified printer has been deleted on Windows 11/10 PC, follow this solution: Restart Print Spool

Table of Contents Solution 1 Solution 21. Delete the temporary files of Windows update 2. Repair damaged system files 3. View and modify registry entries 4. Turn off the network card IPv6 5. Run the WindowsUpdateTroubleshooter tool to repair 6. Turn off the firewall and other related anti-virus software. 7. Close the WidowsUpdate service. Solution 3 Solution 4 "0x8024401c" error occurs during Windows update on Huawei computers Symptom Problem Cause Solution Still not solved? Recently, the web server needs to be updated due to system vulnerabilities. After logging in to the server, the update prompts error code 0x8024401c. Solution 1

To update the curl version under Linux, you can follow the steps below: Check the current curl version: First, you need to determine the curl version installed in the current system. Open a terminal and execute the following command: curl --version This command will display the current curl version information. Confirm available curl version: Before updating curl, you need to confirm the latest version available. You can visit curl's official website (curl.haxx.se) or related software sources to find the latest version of curl. Download the curl source code: Using curl or a browser, download the source code file for the curl version of your choice (usually .tar.gz or .tar.bz2

Title: Analysis of Oracle Error 3114: Causes and Solutions When using Oracle database, you often encounter various error codes, among which error 3114 is a relatively common one. This error generally involves database link problems, which may cause exceptions when accessing the database. This article will interpret Oracle error 3114, discuss its causes, and give specific methods to solve the error and related code examples. 1. Definition of error 3114 Oracle error 3114 pass

The display error is a problem that may occur in the Xiangxiang Fuzhai app. Some users are not sure why the Xiangxiang Fuzhai app displays errors. It may be due to network connection problems, too many background programs, incorrect registration information, etc. Next, This is the editor’s introduction to how to solve app display errors for users. Interested users should come and take a look! Why does the Xiangxiang Fuzhai app display an error answer: network connection problem, too many background programs, incorrect registration information, etc. Details: 1. [Network problem] Solution: Check the device connection network status, reconnect or choose another network connection to use. Can. 2. [Too many background programs] Solution: Close other running programs and release the system, which can speed up the running of the software. 3. [Incorrect registration information

LinuxOops: Detailed explanation of the meaning of this error, need specific code examples What is LinuxOops? In Linux systems, "Oops" refers to a situation where a serious error in the kernel causes the system to crash. Oops is actually a kernel crash mechanism that stops the system when a fatal error occurs and prints out relevant error information so that developers can diagnose and fix the problem. Oops usually occur in kernel space and have nothing to do with user space applications. When the kernel encounters
![Streaming server throws error [FIXED]](https://img.php.cn/upload/article/000/465/014/171133083740341.jpg?x-oss-process=image/resize,m_fill,h_207,w_330)
Are you getting a streaming server throwing an error on your computer? Stremio is a cross-platform video streaming service that you can use to stream and watch movies, TV shows, live TV, and more. Some users have reported getting this error when trying to launch the application. Errors can occur under a variety of circumstances, including Internet and server issues. This error may also be encountered when using the web version of Stremio. Interference from antivirus software or firewalls can also cause errors to occur. Whatever the case, you can fix the problem with this guide. Streaming Server Throws Error While running Stremio application on Windows, you may encounter “Stremio Streaming Server threw error

The Linux kernel is an open source operating system kernel whose source code is stored in a dedicated code repository. In this article, we will analyze the storage path of the Linux kernel source code in detail, and use specific code examples to help readers better understand. 1. Linux kernel source code storage path The Linux kernel source code is stored in a Git repository called linux, which is hosted at [https://github.com/torvalds/linux](http
