本節では、構築時に発生する多くの一般的なエラーを集めたものです。
configure.inからconfigureスクリプトを生成するためには、GNU autoconfパッケージが必要です。CVSサーバからソースを入手した後、 最上位のディレクトリで./buildconfを実行して下 さい。(また、configureに --enable-maintainer-modeオプションを付けて実 行した場合以外は、configureスクリプトはconfigure.inファイルが更 新された際に自動的に再構築を行いません。このため、configure.inが 変更された場合には忘れずに手動で再構築を行う必要があります。 再構築の際に行われることの1つは、configureまたはconfig.statusを 実行した後、Makefileの中の@VARIABLE@のような物を見つけることです。)
configure/setupスクリプトにApacheソースツリーの最上位の場所を指 定する必要があります。これは、' --with-apache=/path/to/apache'を指定するので あって、'--with-apache=/path/to/apache/src'で はないということです。
Cプリプロセッサおよびリンカに次のように追加でフラグを指定するこ とにより、configureスクリプトがヘッダファイルまたはライブラリを 標準以外の場所で探すことが可能となります。
CPPFLAGS=-I/path/to/include LDFLAGS=-L/path/to/library ./configure |
env CPPFLAGS=-I/path/to/include LDFLAGS=-L/path/to/library ./configure |
bisonのバージョンを更新する必要があります。最新版は、 ftp://ftp.gnu.org/pub/gnu/bison/にあります。
古いバージョンのmakeには、functionsディレクトリにあるファイルの コンパイルされたものを同じディレクトリに正しく入れないものがあり ます。"cp *.o functions"を試しに実行してから 'make' を再度実行し、解決されるか確認して下さ い。解決される場合には、GNU makeの最近のバージョンに更新するべき です。
Take a look at the link line and make sure that all of the appropriate libraries are being included at the end. Common ones that you might have missed are '-ldl' and any libraries required for any database support you included.
If you're linking with Apache 1.2.x, did you remember to add the appropriate information to the EXTRA_LIBS line of the Configuration file and re-rerun Apache's Configure script? See the INSTALL file that comes with the distribution for more information.
Some people have also reported that they had to add '-ldl' immediately following 'libphp3.a' when linking with Apache.
This is actually quite easy. Follow these steps carefully:
Grab the latest Apache 1.3 distribution from http://www.apache.org/dist/.
Ungzip and untar it somewhere, for example /usr/local/src/apache-1.3.
Compile PHP by first running ./configure --with-apache=/<path>/apache-1.3 (substitute <path> for the actual path to your apache-1.3 directory.
Type 'make' followed by 'make install' to build PHP and copy the necessary files to the Apache distribution tree.
Change directories into to your /<path>/apache-1.3/src directory and edit the Configuration file. At the end of the file, add: AddModule modules/php3/libphp3.a.
Type: './Configure' followed by 'make'.
You should now have a PHP-enabled httpd binary!
Note: : You can also use the new Apache ./configure script. See the instructions in the README.configure file which is part of your Apache distribution. Also have a look at the INSTALL file in the PHP distribution.
This means that the PHP module is not getting invoked for some reason. Three things to check before asking for further help:
Make sure that the httpd binary you are running is the actual new httpd binary you just built. To do this, try running: /path/to/binary/httpd -l
If you don't see mod_php3.c listed then you are not running the right binary. Find and install the correct binary.
Make sure you have added the correct Mime Type to one of your Apache .conf files. It should be: AddType application/x-httpd-php3 .php3 (for PHP 3)
or AddType application/x-httpd-php .php (for PHP 4)
Also make sure that this AddType line is not hidden away inside a <Virtualhost> or <Directory> block which would prevent it from applying to the location of your test script.
Finally, the default location of the Apache configuration files changed between Apache 1.2 and Apache 1.3. You should check to make sure that the configuration file you are adding the AddType line to is actually being read. You can put an obvious syntax error into your httpd.conf file or some other obvious change that will tell you if the file is being read correctly.
9. --activate-module=src/modules/php4/libphp4.a と書いてありますが、ファイルがありません。このため、 --activate-module=src/modules/php4/libmodphp4.aに 変更しましたが、やはりだめです。何が起きているのでしょう?
Well, you decided to try to outsmart the people who wrote those nice step-by-step instructions for you and you have now discovered that these people cannot be outsmarted. The libphp4.a file is not supposed to exist. The Apache build process will create it.
10. --activate-module=src/modules/php4/libphp4.a を指定し、PHPを静的モジュールとして組み込んでApacheを構築しよう とした際に、システムがANSI対応ではないというエラーを発生します。
Apacheのこのエラーメッセージは紛らわしく、より新しいバージョンで は修整されています。
There are three things to check here. First, for some reason when Apache builds the apxs Perl script, it sometimes ends up getting built without the proper compiler and flags variables. Edit your apxs (sometimes found in /usr/local/apache/bin/apxs or /usr/sbin/apxs) and check for these lines:
my $CFG_CFLAGS_SHLIB = ' '; # substituted via Makefile.tmpl my $CFG_LD_SHLIB = ' '; # substituted via Makefile.tmpl my $CFG_LDFLAGS_SHLIB = ' '; # substituted via Makefile.tmpl |
my $CFG_CFLAGS_SHLIB = '-fpic -DSHARED_MODULE'; # substituted via Makefile.tmpl my $CFG_LD_SHLIB = 'gcc'; # substituted via Makefile.tmpl my $CFG_LDFLAGS_SHLIB = q(-shared);# substituted via Makefile.tmpl |
my $CFG_LIBEXECDIR = 'modules'; # substituted via APACI install |
my $CFG_LIBEXECDIR = '/usr/lib/apache'; # substituted via APACI install |
During the 'make' portion of installation, if you encounter problems that look similar to this:
microtime.c: In function `php_if_getrusage': microtime.c:94: storage size of `usg' isn't known microtime.c:97: `RUSAGE_SELF' undeclared (first use in this function) microtime.c:97: (Each undeclared identifier is reported only once microtime.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 |
Your system is broken. You need to fix your /usr/include files either by making sure your /usr/include/linux symlink is pointing to the right place in your kernel sources or by installing a glibc-devel package that matches your glibc. This has absolutely nothing to do with PHP. To prove this to yourself, try this simple test:
$ cat >test.c <<X #include <sys/resource.h> X $ gcc -E test.c >/dev/null |