Disable PHP debug mode Print

  • 0

Client queries:

========================================================================

There is a domain greensoftechbd.com in the server orbit.mydchub.com.

The domain is getting the following issue

A PHP Error was encountered
Severity: Core Warning
Message: Module 'memcached' already loaded
Filename: Unknown
Line Number: 0
Backtrace:

Please check & solve as soon as possible.

=========================================================================

Understanding:

- This error might be due to display_error mode enabled in the index.php file.

- This should only be enabled for development purposes to fix bugs.

- so, we should disable this in production mode.

 

Solution -1:

1) Login into the server via SSH

2) Open the index.php file under the user (/home/<user-name>/public_html/index.php)

3) locate the function "display_errors and change its value from 1(on) to 0(off). Refer to the below example


error_reporting(-1);
ini_set('display_errors', 0);
break;

 

Solution -2: (Disable the error_reporting function for a particular domain)

 

1) First we have to know which PHP version used in the domain.

- Login into WHM Home » Software » MultiPHP Manager

- Search the domain name in the search box under the User Domain Settings. 

- The domain "greensoftechbd.com" has PHP 7.3 ( ea-php73 ).

2) Login client cPanel:

- Home » Account Information » List Accounts

- Search the domain name "greensoftechbd.com" in the search box.

- Login into the "greensoftechbd.com" user cPanel with help of cPanel icons.

3) Edit MultiPHP INI

- Search or select "MultiPHP INI Editor"

- Select the domain "greensoftechbd.com" under "Editor mode & Edit PHP INI settings"

4)If you want to enable the error_reporting function for only one domain, Remove the proc_open from the following commands & save it:

disable_functions = 

5) If you want to disable the error_reporting function for only one domain, Add the proc_open from the following commands & save it:   

disable_functions = error_reporting

 

Solution -3: (Disable the display_errors for a particular domain)

1) Login into the server via SSH

2) Open the php.ini file under the user (/home/<user-name>/public_html/php.ini)

3) You can disable PHP error reporting simply by putting a php.ini file under the document root of the site with the following line :

display_errors = Off

=========================================================================


Was this answer helpful?

« Back