How to set to default value all PHP settings?

Asked

Viewed 57 times

0

I have a Linux Centos VPS and the garbage collector configuration is wrong. I need to fix it in an easy way since I have very little knowledge of it. I wonder if there’s a way to set all the PHP settings to default. I use the Plesk control panel. There is the option to update PHP to another version, for example from 5.3 to 5.6. I would like to know if using this option all values would return to the normal PHP standard, which is what I need. Thank you.

  • Now I’m curious. Which version of PHP do you use?

  • I use version 5.3 of PHP. And I think about upgrading to version 5.6.

  • 1

    And what do you call "wrong"? Dangerous when you add the phrase "I have little knowledge" and say that something is wrong. If you can give more details, maybe the community can help in some way, beyond the main doubt.

  • Note that some hosts allow you for a proper php.ini or .user.ini at the root (or some equivalent system) that is taken into account by the execution, it depends on how it was configured and what mode of PHP is running. Have a look at the host’s support. This is also: http://php.net/manual/en/configuration.file.per-user.php

  • I have the following error: Error: PHP Notice: session_start(): ps_files_cleanup_dir: opendir(/var/lib/php/Session) failed: Permission denied (13)

  • This error concerns Garbage Collection. I believe the configuration is 0, and it should be 1.

  • This is version problem and not config problem. You can even do a gambiarra changing parameter, but it is better to change version. Changing GC config is not a real solution. Even distros with this problem and this version use crontab to clean GC

  • Then upgrading to version 5.6 would solve the problem?

  • This error appears hourly. The impression is that a CRON is being performed. Since when this error appears, the server is unavailable and inaccessible for a few moments or even minutes, as well as the website that is hosted in this VPS is also unavailable and all queries to the database are accumulated. So I believe it’s a configuration error. I think it is possible that the garbage collector is set to 0 and that is why PHP is collecting garbage via CRON.

  • This link may help something, but I don’t think that’s the problem: http://answall.com/q/167257/4793. Your question needs a more accurate diagnosis, which is impossible to do without access to the environment and besides that is not the purpose of the site. You can provide a more detailed diagnosis in question to increase chances of solving. Version 5.3, for example, does not present this problem. I even have an environment with Plesk and PHP5.3 running normally in production.

Show 5 more comments

1 answer

0

You just need to get the original file, which can be obtained here, is too long to be published here at Stackoverflow.

Within Plesk there must be some "advanced" location to change PHP.ini settings, so just give the famous CTRL+C and CTRL+V. ;)

If you want you can do it via SSH, if you have basic knowledge of SSH.

cd /etc/

Accesses the folder /etc/ (in the case of Plesk should be /etc/php.d)

wget https://raw.githubusercontent.com/php/php-src/master/php.ini-production

Saves the Github file

mv php.ini-production php.ini

Renames the php.ini-production for php.ini.

Restart PHP after such a change. ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.