Enable PHP error logging by default for all PHP versions

8 posts / 0 new
Last post
#1 Wed, 08/01/2018 - 07:00
combine Pro Licensee

Enable PHP error logging by default for all PHP versions

Hello

Is it possible to enable PHP error logging by default for all available PHP versions on a server?

I have looked in Server Templates under PHP Options for a way to enable it by default but no such option exist.

Alternatively is there a way to enable it for all sites on a server by a script so each site gets the log in eg. /home/user/domains/mydomain.com/logs/PHPerror.log

Regards Bo

Wed, 08/01/2018 - 09:29
andreychek

Howdy,

You may need to make the changes in the template php.ini file that you're using.

That is, whatever options exist in the php.ini file being used as the template for new domains would get copied out to any new domain that's added. To make changes for existing sites -- if you want to change a number of php.ini files, you can do that, using the "virtualmin modify-php-ini" command.

That particular command can be used on the command line to make changes to some or all existing options in php.ini files in your domains.

-Eric

Wed, 08/01/2018 - 09:29
andreychek

Howdy,

You may need to make the changes in the template php.ini file that you're using.

That is, whatever options exist in the php.ini file being used as the template for new domains would get copied out to any new domain that's added. To make changes for existing sites -- if you want to change a number of php.ini files, you can do that, using the "virtualmin modify-php-ini" command.

That particular command can be used on the command line to make changes to some or all existing options in php.ini files in your domains.

-Eric

Thu, 08/02/2018 - 03:47
combine Pro Licensee

Hi Eric,

How do I find the template virtualmin uses for each PHP version, so I can start with a clean copy of the template.

-Bo

Mon, 08/27/2018 - 04:34
combine Pro Licensee

Hi Eric,

I use CentOS with 2-4 PHP versions installed. How do I identify what php.ini is used as a template for each version?

-Bo

Tue, 11/06/2018 - 04:05
combine Pro Licensee

How nice. No help for months. :-(

Tue, 11/06/2018 - 05:46
marcelorp

Did you use PHP-FPM for run the websites?

Tue, 11/06/2018 - 06:04
TheRavenKing Pro Licensee

@combine,
Well no comment might be because your general knowledge as sysadmin most here would expect you to know some basic commands or look it up on the big internet.

here you go:

yum install which mlocate
updatedb
php -v
which php
locate php.ini

https://www.virtualmin.com/documentation/webdev/php

Scroll a bit down there you find command to update all your php.ini files in one go