X
X

Select Your Currency

Türk Lirası $ US Dollar Euro

How do I turn on PHP errors?

As first you need to check if you can change the PHP version on page ‘Domain setup’ under your domain in DirectAdmin. If you are a reseller then you can find this option under user level. If it is possible to change the PHP version on page ‘Domain setup’ under your domain then you can add the following code in your .htaccess file. You can find this file in directory: domains -> yourdomain.com -> public_html.

php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag log_errors on

Is it not possible to change the PHP version on page ‘Domain Setup’ in DirectAdmin? Then you can change the PHP version on page ‘Select PHP version’ under Advanced Features. To show PHP errors on your page you can follow the following steps.

Wordpress

To show PHP errors on your Wordpress website you need to edit your wp-config.php file in DirectAdmin. You need to log on to DirectAdmin, choose ‘File manager’ and go to folder domains -> yourdomain.com -> public_html. Click on ‘edit’ for your file wp-config.php and add the following code at the bottom of your file:

Define( 'WP_DEBUG', true );

Now save your file and go back to your website, refresh your page and the PHP errors are now visible.

Joomla

With Joomla is it possible to show PHP errors when you enable the debug mode in your configuration.php file. You need to log on to DirectAdmin, choose ‘File manager’ and go to directory domains -> yourdomain.com -> public_html. Click on ‘edit’ for your file configuration.php and change the following code:

public $error_reporting = 'default':

To the following code:

public $error_reporting = 'E_ALL | E_STRICT':

Now save your file and go back to your website, refresh your page and the PHP errors are now visible.

Magento

To make PHP errors visible for Magento you can follow the following steps. Login to DirectAdmin and go to ‘File Manager’, browse to folder domains -> yourdomain.com -> public_html.

1. Here you will find the folder ‘pub’, click on folder ‘pub’ and then click on folder ‘errors’. Here you will find the file ‘local.xml.sample’, rename this file to name ‘local.xml’.
2. Now go back to your website and refresh your page, now you will see the PHP errors.

In case the PHP errors are not displayed on your website then you need to add some code in your index.php, this file is located on domains -> yourdomain.com -> public_html. Click on ‘edit’ for your file index.php and add the following code at the bottom of your file:

error_reporting(E_ALL);
ini_set('display_errors', 1);

Now save your file and go back to your website, refresh your page and the PHP errors are now visible.

Drupal

To show PHP errors in Drupal you need to add the following code in your file settings.php, you can find this file in directory domains -> yourdomain.com -> public_html in Directadmin. First, log on to DirectAdmin and click on ‘File manager’, browse to folder public_html and click on ‘edit’ for file settings.php. Now add the following code:

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

Now save your file and go back to your website, refresh your page and the PHP errors are now visible.

Can't find the information you are looking for?

Create a Support Ticket
Did you find it useful?
(146 times viewed / 0 people found it helpful)