1

I asked this question recently : PHP is not working on server

I asked my hosting service provider to enable these extensions in php.ini by removing semi colon .

;extension=php_mysql.so
;extension=php_mysqli.so
;extension=php_pdo_mysql.so

They replied me that there is no option like this present in php.ini file.

Please tell me what I tell them to what to do? Because without this I can't connect to database and many more things.

Note : They are running in Linux.

Community
  • 1
  • 1
user3462619
  • 31
  • 1
  • 1
  • 2

3 Answers3

3

Dear there can be 2 possible issues, if mysqli is not working on server.

1- php mysqli is not installed.
2- extension is disabled.

If you have putty excess you try this command to install it.

apt-get install php-mysqlnd

or

yum install php-mysqlnd

Otherwise enable the service from php.ini:

extension=mysql.so
extension=mysqli.so
extension=pdo_mysql.so
Alberto Perez
  • 1,019
  • 15
  • 17
Saqib Ahmed
  • 1,240
  • 1
  • 15
  • 25
2

The extensions are most likely present as:

;extension=mysql.so
;extension=mysqli.so
;extension=pdo_mysql.so

Without the php_ prefix, and if they are not present they should just add it, provided that the extension library is really present on the system.

On some distributions the extensions are configured each in their own ini file. For example you will find the mysqli setting on debian in the file /etc/php5/mods-available/mysqli.ini and you can enable it using this command:

php5enmod mysqli
Massimiliano Torromeo
  • 1,801
  • 1
  • 15
  • 17
0

You can make your own php.ini file on the basis of need. Make a file with your by writing all the extensions etc and save it as php.ini and put it in your folder where you are using this code.

Teerath Kumar
  • 488
  • 5
  • 15