mysql in php compileren, maar hoe :?

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

  • Haranaka
  • Registratie: September 2000
  • Laatst online: 07-06 23:13
Ik draai een mysql server op een andere machine dan mijn webserver. Op deze webserver zit apache geinstaleerd met php support. Maar nu wil ik met php een connectie maken naar mysql, maar dan zegt hij:

Fatal error: Call to undefined function: mysql_connect() in /l2/httpd/hoom/test.php on line 3

Na wat gezoek op in de php manual:

These functions allow you to access MySQL database servers. In
order to have these functions available, you must compile PHP
with MySQL support by using the --with-mysql option. If you
use this option without specifying the path to MySQL, PHP will
use the built-in MySQL client libraries. Users who run other applications that use MySQL (for example, running PHP 3 and PHP 4
as concurrent apache modules, or auth-mysql) should always
specify the path to MySQL:
--with-mysql=/path/to/mysql.
This will force PHP to use the client libraries installed by
MySQL, avoiding any conflicts.

Maar nu snap ik niet wat ik moet doen :? Kan iemand me op weg helpen?

...


  • Mior
  • Registratie: Maart 2000
  • Laatst online: 15-08 00:58
Tijdens het configuren van php, --with-mysql opgeven (eventueel met /path/to als hij het niet kan vinden).

  • Haranaka
  • Registratie: September 2000
  • Laatst online: 07-06 23:13
Sorry...
Maar hoe moet dat precies, php configureren?
Ik kan wel een php.ini vinden daar staat ook wel wat in over mysql maar dat bedoelen jullie zeker niet
php --with-mysql
doet ook niets...

* Haranaka weet het niet |:(

...


  • Onno
  • Registratie: Juni 1999
  • Niet online
Source downloaden en extracten, './configure --with-mysql' (+overige opties die je wilt) doen, en daarna 'make' en 'make install'.

Zie ook de documentatie: http://www.php.net/manual/en/installation.php

Met phpinfo() kun je overigens de huidige opties laten zien waarmee PHP gecompileerd is.

  • Haranaka
  • Registratie: September 2000
  • Laatst online: 07-06 23:13
php was wel geinstaleerd.
phpinfo():

'./configure' '--prefix=/usr' '--with-config-file-path=/etc' '--disable-debug' '--enable-pic' '--enable-shared' '--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs' '--with-exec-dir=/usr/bin' '--with-regex=system' '--with-gettext' '--with-gd' '--with-jpeg-dir=/usr' '--with-png' '--with-zlib' '--with-db2' '--with-db3' '--with-gdbm' '--enable-debugger' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-yp' '--enable-ftp' '--enable-wddx' '--without-mysql' '--without-oracle' '--without-oci8' '--with-xml'

Hoe krijg ik voorelkaar dat hij die instelling veranderd?
[edit]
Of moet ik gewoon downloaden, en eroverheen instaleren met de juiste opties?

...


Verwijderd

Installatie onder UNIX :

1. gunzip apache_1.3.x.tar.gz
2. tar xvf apache_1.3.x.tar
3. gunzip php-x.x.x.tar.gz
4. tar xvf php-x.x.x.tar
5. cd apache_1.3.x
6. ./configure --prefix=/www
7. cd ../php-x.x.x
8. ./configure --prefix=/usr --with-config-file-path=/etc --disable-debug --enable-pic --enable-shared --enable-inline-optimization --with-apxs=/usr/sbin/apxs --with-exec-dir=/usr/bin --with-regex=system --with-gettext --with-gd --with-jpeg-dir=/usr --with-png --with-zlib --with-db2 --with-db3 --with-gdbm --enable-debugger --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-yp --enable-ftp --enable-wddx --with-mysql --without-oracle --without-oci8 --with-xml
9. make
10. make install
11. cd ../apache_1.3.x
12. ./configure --activate-module=src/modules/php4/libphp4.a
13. make
14. make install
15. cd ../php-x.x.x
16. cp php.ini-dist /usr/local/lib/php.ini
17. Edit je httpd.conf of srm.conf file en voeg het volgende toe:
AddType application/x-httpd-php .php

18. Herstart de apache server (niet gewoon een reload)


En dat wordt dus inderdaad opnieuw dowloaden en compilen/installeren ...
Pagina: 1