[php5+apache2] PHP wil niet samen met Apache

Pagina: 1
Acties:
  • 132 views sinds 30-01-2008
  • Reageer

  • BSeB
  • Registratie: Juni 2001
  • Laatst online: 22-09-2025
Ik heb net apache2 geinstalleerd, verder even httpd.conf aangepast aan mijn wensen, daarna heb ik fijn php geinstalleerd samen met ondersteuning voor mysql, hierna in de config van apache nog even de volgende regel erin gezet:

LoadModule php5_module libexec/libphp5.so

Dit zal niet werken omdat die module op de volgende plaats staat:

/usr/local/apache2/modules/libphp5.so

Hiervoor heb ik dus een symlink gemaakt. Maar nu krijg ik de volgende error en ik en een vriend van mij weten nu eigenlijk niet wat we fout doen. Op internet is eigenlijk niks erover te vinden.

Php en apache zijn geinstalleerd zoals in de handleiding van apache staat, dus met so ondersteuning.

De error die ik nu krijg is als volgt:

Syntax error on line 238 of /etc/apache/httpd.conf:
Cannot load /usr/libexec/libphp5.so into server: /usr/libexec/libphp5.so: undefined symbol: apr_table_set
/usr/sbin/apachectl start: httpd could not be started

Kan iemand mij hiermee helpen?

  • r0b
  • Registratie: December 2002
  • Laatst online: 08-02 21:45

r0b

offtopic:
Waarom load je nu alles op de oude apache1.x manier onder Apache2? Sinds apache2 kan je modules enablen via a2enmod en disablen met a2dismod.

  • BSeB
  • Registratie: Juni 2001
  • Laatst online: 22-09-2025
Apache 2.0 on Unix systems

This section contains notes and hints specific to Apache 2.0 installs
of PHP on Unix systems.

Warning

We do not recommend using a threaded MPM in production with Apache2.
Use the prefork MPM instead, or use Apache1. For information on why,
read the related FAQ entry on using Apache2 with a threaded MPM

You are highly encouraged to take a look at the Apache Documentation
to get a basic understanding of the Apache 2.0 Server.

PHP and Apache 2.0.x compatibility notes: The following versions of
PHP are known to work with the most recent version of Apache 2.0.x:

* PHP 4.3.0 or later available at http://www.php.net/downloads.php.
* the latest stable development version. Get the source code
http://snaps.php.net/php4-latest.tar.gz or download binaries for
Windows http://snaps.php.net/win32/php4-win32-latest.zip.
* a prerelease version downloadable from http://qa.php.net/.
* you have always the option to obtain PHP through anonymous CVS.

These versions of PHP are compatible to Apache 2.0.40 and later.

Apache 2.0 SAPI-support started with PHP 4.2.0. PHP 4.2.3 works
with Apache 2.0.39, don't use any other version of Apache with PHP
4.2.3. However, the recommended setup is to use PHP 4.3.0 or later
with the most recent version of Apache2.

All mentioned versions of PHP will work still with Apache 1.3.x.

Download the most recent version of Apache 2.0 and a fitting PHP
version from the above mentioned places. This quick guide covers only
the basics to get started with Apache 2.0 and PHP. For more
information read the Apache Documentation. The version numbers have
been omitted here, to ensure the instructions are not incorrect. You
will need to replace the 'NN' here with the correct values from your
files.

Example 2-4. Installation Instructions (Apache 2 Shared Module
Version)
1. gzip -d httpd-2_0_NN.tar.gz
2. tar xvf httpd-2_0_NN.tar
3. gunzip php-NN.tar.gz
4. tar -xvf php-NN.tar
5. cd httpd-2_0_NN
6. ./configure --enable-so
7. make
8. make install

Now you have Apache 2.0.NN available under /usr/local/apache2,
configured with loadable module support and the standard MPM prefork.
To test the installation use your normal procedure for starting
the Apache server, e.g.:
/usr/local/apache2/bin/apachectl start
and stop the server to go on with the configuration for PHP:
/usr/local/apache2/bin/apachectl stop.

9. cd ../php-NN

10. Now, configure your PHP. This is where you customize your PHP
with various options, like which extensions will be enabled. Do a
./configure --help for a list of available options. In our example
we'll do a simple configure with Apache 2 and MySQL support. Your
path to apxs may differ, in fact, the binary may even be named apxs2 on
your system.

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql

11. make
12. make install

If you decide to change your configure options after installation,
you only need to repeat the last three steps. You only need to
restart apache for the new module to take effect. A recompile of
Apache is not needed.

Note that unless told otherwise, 'make install' will also install PEAR,
various PHP tools such as phpize, install the PHP CLI, and more.

13. Setup your php.ini

cp php.ini-dist /usr/local/lib/php.ini

You may edit your .ini file to set PHP options. If you prefer having
php.ini in another location, use --with-config-file-path=/some/path in
step 10.

If you instead choose php.ini-recommended, be certain to read the list
of changes within, as they affect how PHP behaves.

14. Edit your httpd.conf to load the PHP module. The path on the right hand
side of the LoadModule statement must point to the path of the PHP
module on your system. The make install from above may have already
added this for you, but be sure to check.

For PHP 4:

LoadModule php4_module libexec/libphp4.so

For PHP 5:

LoadModule php5_module libexec/libphp5.so

/usr/local/apache2/modules/libphp5.so


15. Tell Apache to parse certain extensions as PHP. For example,
let's have Apache parse the .php extension as PHP. You could
have any extension(s) parse as PHP by simply adding more, with
each separated by a space. We'll add .phtml to demonstrate.

AddType application/x-httpd-php .php .phtml

It's also common to setup the .phps extension to show highlighted PHP
source, this can be done with:

AddType application/x-httpd-php-source .phps

16. Use your normal procedure for starting the Apache server, e.g.:

/usr/local/apache2/bin/apachectl start

Following the steps above you will have a running Apache 2.0 with
support for PHP as SAPI module. Of course there are many more
configuration options available for both, Apache and PHP. For more
information use ./configure --help in the corresponding source tree.
In case you wish to build a multithreaded version of Apache 2.0 you
must overwrite the standard MPM-Module prefork either with worker or
perchild. To do so append to your configure line in step 6 above
either the option --with-mpm=worker or --with-mpm=perchild. Take care
about the consequences and understand what you are doing. For more
information read the Apache documentation about the MPM-Modules.

Note: If you want to use content negotiation, read the Apache
MultiViews FAQ.

Note: To build a multithreaded version of Apache your system must
support threads. This also implies to build PHP with experimental
Zend Thread Safety (ZTS). Therefore not all extensions might be
available. The recommended setup is to build Apache with the
standard prefork MPM-Module.

Als je mij kunt vertellen hoe ik het anders moet doen. In windows had ik het idd via modules altijd.

  • BSeB
  • Registratie: Juni 2001
  • Laatst online: 22-09-2025
Niemand

  • Boudewijn
  • Registratie: Februari 2004
  • Niet online

Boudewijn

omdat het kan

psst:

niet schoppen binnen 24 uur , vinden mods niet tof.


ontopic:
Ik zou gewoon een loadModule gebruiken, doe ik zelf ook ... en gaat keurig (gentoo, apache-2.0.53, php4).

Zaram module kopen voor je glasvezelaansluiting?


  • BSeB
  • Registratie: Juni 2001
  • Laatst online: 22-09-2025
BoudewijnLinux schreef op zaterdag 09 juli 2005 @ 19:10:
Ik zou gewoon een loadModule gebruiken, doe ik zelf ook ... en gaat keurig (gentoo, apache-2.0.53, php4).
Zoals bovenstaand te lezen is doe ik dat toch ook gewoon? :?

Wat doe ik fout dan?

  • Boudewijn
  • Registratie: Februari 2004
  • Niet online

Boudewijn

omdat het kan

BSeB schreef op zaterdag 09 juli 2005 @ 19:29:
[...]


Zoals bovenstaand te lezen is doe ik dat toch ook gewoon? :?

Wat doe ik fout dan?
ik haakte op de discussie van de rest in ;)

geen idee wat er bij jou misgaat.

Zaram module kopen voor je glasvezelaansluiting?


  • Lancer
  • Registratie: Januari 2002
  • Laatst online: 10:07

Lancer

What the......

1) Kan ld alle libraries vinden?
2) met ldd -d /usr/local/apache2/modules/libphp5.so kun je zien van welke libs je afhankelijk bent en welke symbols niet resolven
3) Welke paden heb je tijdens de configure van php meegegeven en kloppen deze met je installatie. Wellicht is het wijs de configure opnieuw te draaien en de juiste paden mee te geven (verwijder wel ff de config.cache; config.status etc. uit de source tree, anders zou het nog wel eens mis kunnen gaan).

Het builden van php is geen pretje en kan soms een behoorlijk aantal pogingen vergen. Als je het aan de praat hebt, leg dan zeker de gegeven commando's vast voor de volgende versie.

Je kunt niet in een systeem meten zonder het systeem te beinvloeden.... (gevolg van de Heisenberg onzekerheidsrelatie)


Verwijderd

Aangezien je Gentoo gebruikt, heb je emerge gebruikt?
Of heb je zelf zitten klooien met sources etc?

[ Voor 86% gewijzigd door Verwijderd op 09-07-2005 21:17 ]


  • Boudewijn
  • Registratie: Februari 2004
  • Niet online

Boudewijn

omdat het kan

Verwijderd schreef op zaterdag 09 juli 2005 @ 21:15:
Aangezien je Gentoo gebruikt, heb je emerge gebruikt?
Of heb je zelf zitten klooien met sources etc?
waar haal je dat vandaan? Ik lees het niet terug, ook niet in de sys-specs van de TS. Het interesseert mij namelijk ook wel of de TS zijn package manager (welke distro???) gebruikt of inderdaad zelf met de sources heeft gewerkt (lijkt me wel, aan zijn startpost te zien)

Zaram module kopen voor je glasvezelaansluiting?


  • BSeB
  • Registratie: Juni 2001
  • Laatst online: 22-09-2025
Mijn systeem specs:

Slackware laatste versie, ook de orginele kernel
Verder werk ik alleen met sources en nooit met rpm's

Verwijderd

BoudewijnLinux schreef op zaterdag 09 juli 2005 @ 22:52:
[...]


waar haal je dat vandaan? Ik lees het niet terug, ook niet in de sys-specs van de TS. Het interesseert mij namelijk ook wel of de TS zijn package manager (welke distro???) gebruikt of inderdaad zelf met de sources heeft gewerkt (lijkt me wel, aan zijn startpost te zien)
Ik ben een beetje scheel, ik las dit:
BoudewijnLinux schreef op zaterdag 09 juli 2005 @ 19:10:
Ik zou gewoon een loadModule gebruiken, doe ik zelf ook ... en gaat keurig (gentoo, apache-2.0.53, php4).

  • BSeB
  • Registratie: Juni 2001
  • Laatst online: 22-09-2025
Na het commando:

ldd -d /usr/local/apache2/modules/libphp5.so

Krijg ik de volgende waslijst B)

undefined symbol: ap_rwrite (/usr/local/apache2/modules/libphp5.so)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x4030a000)
libresolv.so.2 => /lib/libresolv.so.2 (0x40338000)
libm.so.6 => /lib/libm.so.6 (0x4034c000)
libdl.so.2 => /lib/libdl.so.2 (0x4036f000)
libnsl.so.1 => /lib/libnsl.so.1 (0x40373000)
libz.so.1 => /usr/lib/libz.so.1 (0x40389000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x4039a000)
libc.so.6 => /lib/libc.so.6 (0x404a1000)
/lib/ld-linux.so.2 (0x80000000)
libpthread.so.0 => /lib/libpthread.so.0 (0x405bf000)
undefined symbol: apr_table_set (/usr/local/apache2/modules/libphp5.so)
undefined symbol: apr_table_add (/usr/local/apache2/modules/libphp5.so)
undefined symbol: apr_pstrdup (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_set_content_type (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_get_brigade (/usr/local/apache2/modules/libphp5.so)
undefined symbol: apr_brigade_flatten (/usr/local/apache2/modules/libphp5.so)
undefined symbol: apr_brigade_cleanup (/usr/local/apache2/modules/libphp5.so)
undefined symbol: apr_table_get (/usr/local/apache2/modules/libphp5.so)
undefined symbol: apr_table_elts (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_rflush (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_log_rerror (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_log_error (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_add_version_component (/usr/local/apache2/modules/libp
hp5.so)
undefined symbol: ap_mpm_query (/usr/local/apache2/modules/libphp5.so)
undefined symbol: apr_pool_userdata_get (/usr/local/apache2/modules/libphp5.so)
undefined symbol: apr_pool_cleanup_null (/usr/local/apache2/modules/libphp5.so)
undefined symbol: apr_pool_cleanup_register (/usr/local/apache2/modules/libp
hp5.so)
undefined symbol: apr_pool_userdata_set (/usr/local/apache2/modules/libphp5.so)
undefined symbol: apr_table_unset (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_auth_type (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_add_common_vars (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_add_cgi_vars (/usr/local/apache2/modules/libphp5.so)
undefined symbol: apr_bucket_eos_create (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_pass_brigade (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_update_mtime (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_set_last_modified (/usr/local/apache2/modules/libphp5.so)
undefined symbol: apr_palloc (/usr/local/apache2/modules/libphp5.so)
undefined symbol: apr_brigade_create (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_hook_pre_config (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_hook_post_config (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_hook_handler (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_server_root_relative (/usr/local/apache2/modules/libp
hp5.so)
undefined symbol: ap_sub_req_lookup_uri (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_destroy_sub_req (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_run_sub_req (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_get_server_version (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_loaded_modules (/usr/local/apache2/modules/libphp5.so)
undefined symbol: unixd_config (/usr/local/apache2/modules/libphp5.so)
undefined symbol: ap_server_root (/usr/local/apache2/modules/libphp5.so)

  • BSeB
  • Registratie: Juni 2001
  • Laatst online: 22-09-2025
Ik zie dnek ik wat het probleem is, er is op deze server vanuit slack apache versie 1 geinstalleerd en zelf heb ik apache versie 2 geinstalleerd.

  • igmar
  • Registratie: April 2000
  • Laatst online: 31-01 23:50

igmar

ISO20022

BSeB schreef op vrijdag 08 juli 2005 @ 21:30:
Syntax error on line 238 of /etc/apache/httpd.conf:
Cannot load /usr/libexec/libphp5.so into server: /usr/libexec/libphp5.so: undefined symbol: apr_table_set
/usr/sbin/apachectl start: httpd could not be started

Kan iemand mij hiermee helpen?
de compile is niet goed gegaan, en waarschijnlijk is de oorzaak een compile waar dingen in terugkomen van een al geinstalleerde apache 1 versie.

  • BSeB
  • Registratie: Juni 2001
  • Laatst online: 22-09-2025
Ik ben nu inderdaad opnieuw begonnen, met pkgtool de oude apache en php verwijderd (gedeinstalleerd), daarna apache opnieuw geprobeerd te installeren, maar dat geeft nog problemen, misschien moet ik de huidige apache apache2 ook eerst deinstalleren voordat ik helemaal opnieuw kan beginnen.

Hij zeurt nu om een map httpd die er niet is, kan ook een bestand zijn aangezien ik gisteren het heb gedaan en vandaag net uit bed kom. Ik zla zo is verder gaan proberen

  • Lancer
  • Registratie: Januari 2002
  • Laatst online: 10:07

Lancer

What the......

Probeer eens ./configure --help en bestudeer de output. Waarschijnlijk moet je met de hand een paar zoekpaden zetten. Er zijn best veel opties. Een voorbeeld:

./configure --with-config-file-path=/usr/local/etc --with-config-file-scan-dir=/usr/local/etc/php.d --enable-force-cgi-redirect --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-db4 --with-curl=/opt/sfw --with-freetype-dir=/usr/local --with-png-dir=/usr/local --with-gd --enable-gd-native-ttf --with-gdbm --with-gettext --with-ncurses --with-iconv=/usr/local --with-jpeg-dir=/usr/sfw --with-tiff-dir=/usr/sfw --with-openssl=/usr/local/ssl --with-pspell --with-regex=system --with-xml --with-expat-dir=/usr/local --with-dom=shared --with-dom-xslt --with-xmlrpc=shared --with-zlib --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-discard-path --enable-track-vars --enable-trans-sid --without-oci8 --with-ldap=shared '--with-mysql=shared,/usr/local/mysql32' --disable-memory-limit --with-apxs2=/usr/local/apache2/bin/apxs --enable-bcmath --enable-shmop --with-cyrus=/opt/build/cyrus-imapd-2.1.16 --enable-dba --enable-dio --enable-exif --with-mime-magic --enable-mcal '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--enable-force-cgi-redirect' '--with-imap=shared,/usr/local/imap-2002e'

(Zoe deed ik de configure altijd op me Solaris bak). Het kan dus zijn dat je b.v. --with-config-path ff op de juiste waarde moet zetten.

Je kunt niet in een systeem meten zonder het systeem te beinvloeden.... (gevolg van de Heisenberg onzekerheidsrelatie)


  • BSeB
  • Registratie: Juni 2001
  • Laatst online: 22-09-2025
Ik heb het voor elkaar, het was dus inderdaad het probleem dat de oude apache en oude php waren geinstaleerd, deze gisteren verwijderd en vandaag handmatig alle geinstalleerde dirsd nog van apache 1 en 2 verwijderd. Hierna neiuwe install gedaan van beide zoals in het PHP INSTALL doc staat.

Nu helemaal geen problemen meer en het werkt als een zonnetje. Top.
Pagina: 1