Remove Domain Name or Website from Control Panel
Managing domains is a routine task in any control panel. Whether you want to remove…
If you cannot seem to connect to MySQL with a PHP script then it might happen due to the PHP scripts under a domain are not able to connect to the MySQL server. You might have mentioned the connection strings correctly but still not able to connect MySQL through scripts. To sort this error you can do the following steps:
Locate the server’s php.ini.
[root@server ~]# php -i | grep php.ini
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini
Here we are considering the server is a su-exe server. Copy php.ini file to the document of the domain.
[root@server ~]# cp /usr/local/lib/php.ini /home/test/public_html
Once you have done this go to the document root of the domain and edit the php.ini file as follows:
[root@server ~]# cd /home/test/public_html
Open the php.ini file and locate the following line:
[root@server public_html]# vi php.ini
Locate for the line:
[SQL]
sql.safe_mode = On
Now change this flag setting to Off
[SQL]
sql.safe_mode = Off
Save the settings and restart the Apache service on the server.
[root@server ~]# /etc/init.d/httpd restart
Through these steps you will be able to connect MySQL with PHP scripts.
Explore more hosting insights, tips and industry updates.
Managing domains is a routine task in any control panel. Whether you want to remove…
Transferring emails from G Suite to a cPanel server can be beneficial under certain conditions,…
0x800CCC00 LOAD_SICILY_FAILED – Authentication did not load.0x800CCC01 INVALID_CERT_CN – Invalid certificate content0x800CCC02 INVALID_CERT_DATE – Invalid…