Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Call to undefined function mysql_connect()

Empfohlene Antworten

Guten Morgen,

habe ein phpscript, das eine datenbank auf einem mysqlserver erstellt.

über browser aufrufen--> funktioniert alles

über terminal: php db.php --> erhalte ich diese fehlermeldung:

Call to undefined function mysql_connect()

kann mir jemand helfen?

mfg. dela

Es gibt normalerweise zwei unterschiedliche PHP-Konfigurationen auf deinem System. Eine ist für die PHP-Umgebung im Webserver zuständig und die andere für die CLI-Umgebung. Es sieht so aus, als wenn die Konfiguration für die CLI keinen MySQL-Support besitzt.

ich habe PHP Version 5.3.1,

kannst du mir sagen wie ich diese konfiguration aktivieren bzw. installieren soll.?

Package matching mysql-5.0.77-4.el5_5.3.i386 already installed

Hi,

php -i |grep mysql
und
php -m |grep mysql
bringen dich weiter. Via
php --ini
siehst du, wo die CLI-spezifischen Configs liegen.
php --rf mysql_connect

zeigt dir, ob PHP diese Funktion kennt.

Prüfen, ob php5-mysql installiert ist.

Gruß

axxis

also,

php -i |grep mysql--> gibt eine liste mit befehlen aus

php -m |grep mysql--> tut gar nichts

php --ini --> hängt

php --rf mysql_connect--> Exception: Function mysql_connect() does not exist

gibt es denn nicht einen befehl mit dem ich alle funktionen aktivieren kann? damit alles funktioniert=)

php -i |grep mysql--> gibt eine liste mit befehlen aus

Nein, es gibt dir die Optionen + Werte deiner Config aus!

php -m |grep mysql--> tut gar nichts

Da hast du deine Lösung, siehe unten

php --ini --> hängt

:confused:

Da du kein Ergebnis bei php -m |grep mysql erhälst, ist MySQL nicht als Modul für PHP verfügbar/geladen.

Hast du geprüft, ob du php5-mysql installiert hast? Ich tippe stark darauf, dass dies bei dir fehlt.

[~]$ sudo yum install php5-mysql

Loaded plugins: rhnplugin, security

Setting up Install Process

No package php5-mysql available.

Nothing to do

sry, aber i-wie kom ich nicht damit klar...

ich benutze red hat 5.6

ja, aber das konnte nicht installiert werden, da php-common eine andere version hatte...

aber inzwischen funktioniert alles,

danke für eure unterstützung

mfg. dela

php-common ---> downgrade

php-mysql ---> install

so waren die beiden wieder miteinander kompatibel.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.