4

I'm attempting to get the link shortening PHP scripts YOURLS working on my basic web server running Lubuntu 12.04.

I have a MySQL database created and PHP5 installed. When I attempt to access the administration interface for YOURLS in a browser, I am presented with the following message:

Fatal Error: ezSQL_mysql requires mySQL Lib to be compiled and or linked in to the PHP engine

I'm very new to MySQL and PHP, so I don't know how to approach this problem. Could you point me in the right direction on this?

(For a quick guide to setting up YOURLS, you can see this video to get the general idea.)

Rolando Isidoro
  • 4,983
  • 2
  • 31
  • 43
d3pd
  • 7,935
  • 24
  • 76
  • 127

5 Answers5

1

You need to ensure that the MySQL extension is loaded into PHP.ini, and has been compiled into PHP as well.

bear
  • 11,364
  • 26
  • 77
  • 129
  • 1: ensure that the MySQL extension is loaded into php.ini ... cat /etc/php5/cli/php.ini | grep MySQL ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. [MySQL] ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. [MySQLi] ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. ; used to tune and monitor MySQL operations. ; used to tune and monitor MySQL operations. ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. – d3pd Dec 08 '12 at 01:00
  • According to [this](http://ocaoimh.ie/2007/01/03/cannot-load-mysql-extension-please-check-your-php-configuration/), I should be seeing something like "extension=mysql.so" in the php.ini file. I don't see it there. Should I add it? If so, can it be added directly to the file? – d3pd Dec 08 '12 at 01:02
  • 2: ensure that the MySQL extension has been compiled into PHP ... I don't really know how to go about doing this. According to [this](http://stackoverflow.com/questions/11097531/check-if-php-has-been-compiled-with-mysql#comment14539564_11097531), I may be able to see loaded extensions using php -m: php -m | grep mysql mysql mysqli pdo_mysql Could you advise on what I should attempt next? Many thanks for your assistance. – d3pd Dec 08 '12 at 01:03
1

Install mysql-devel and php-mysqli packages

yum install mysql-devel php-mysqli

Names can change a bit as Ernest show's in his answer.

lcjury
  • 1,158
  • 1
  • 14
  • 26
0

If you have installed your php server and mysql through yum, try to use yum to search for the relevant package.

For example, if you used "yum install php55", try "yum search php55", then look for something like "php55-mysqld". If found, install it "yum install php-mysqld". That will install the required module for PHP to interact with your mysql.

Ernest Han
  • 395
  • 1
  • 3
  • 10
-1

Installing all php packages and its dependencies worked for me.

yum install php-*

HBT
  • 19
  • 2
  • As far as this can solve the problem, I discourage anybody to do this. there are tons of packages who start with php-*. This solves the problem, but is not the solution. – lcjury May 28 '18 at 17:16
-3

finnaly i Found the solution just change this line > class ezSQL_mysql extends ezSQLcore in ez_sql_mysql.php

to class ezSQL_mysqlx extends ezSQLcore

:)