• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How to edit php.ini

S

sami1983

Guest
I am managing my clients server and I need to edit the php.ini for some new directives, I don't have the root password, but I am logged in as the admin, I would need either a password for root or to add my account to the sudoer, any ideas would be much appreciated.
 
Why "PHP Settings" tab for domain is not enough for you?
 
Why? "PHP Settings" tab is in "Custom View Settings", that's why. Who is the genius who decided to put it in the 'view' settings? It's certainly miscategorized and that's not the first place I'd look for PHP settings. The only relavent tab in the Custom View Settings is Administrative Tools. Change the name to 'Custom Settings' and then ask me whether it's enough for me or not and I'd be glad to let you know, Igor.
 
"Custom View Settings"? Hmmm... I see this tab in Hosting setting for domain. Look at attached picture.
 

Attachments

  • FireShot Screen Capture #020 - 'Hosting Settings for em_em - Parallels Plesk Panel 10_4_4' - ppu.png
    FireShot Screen Capture #020 - 'Hosting Settings for em_em - Parallels Plesk Panel 10_4_4' - ppu.png
    14.4 KB · Views: 87
Is that for domain-specific PHP settings? If you look under the Server/Custom View Settings/PHP Settings, it's the same, unless it's for the server-wide settings.
 
Last edited by a moderator:
Здравствуйте!

У меня есть веб сервер на plesk.
В силу внутренних причин мне необходимо изменить sendmail_path на всех доменах сервера.
С сайтами на модуле Apache всё просто - там php.ini один.
Но на сервере также около сотни сайтов в режиме FastCGI. php.ini у каждого свой, соответственно.

Из этого всего вытекают вопросы:
1. Возможно ли изменить содержание всех выделенных php.ini из одного места? (Замена текста в шаблоне PP_CUSTOM_PHP_INI и переконфигурирование всех виртуальных хостов, например )
2. Если да, то где менять?
3. Есть второй способ - это find и sed. Перезапишутся ли кастомные php.ini на шаблонные после переконфигурации этого домена\всех доменов?

Менять вручную я опасаюсь, т.к. не уверен, что при переконфигурировании вирт. хоста не подцепится php.ini из шаблона.


UPD:
Проверил, вроде как не перезаписывается и можно менять ручками. Команда здесь:
find /var/www/vhosts/*/etc/ -name php.ini -type f -exec sed -i -e 's|СТАРОЕ_ЗНАЧЕНИЕ_СТРОКА_ПОЛНОСТЬЮ|НОВОЕ_ЗНАЧЕНИЕ_СТРОКА_ПОЛНОСТЬЮ|g' '{}' \;
 
Last edited:
tanatonaut, Вообще, самый правильный способ - это определить нужные кастомные настройки для PHP Settings в сервис плане и засинхронизировать его на существующие подписки. После этого они уже точно не перезапишутся и все новые подписки на этом плане будут создаваться уже с этими кастомными настройками.

Кстати, по-умолчанию на форуме принято писать на English. Поэтому, прошу все же придерживаться этого правила, для удобства остальных пользователей. Спасибо.
 
IgorG,
Учту Ваше замечание, спасибо.
Based on my recent experience:
the most correct way of your - the wrong way, in my opinion.
Let me explain my point of view:
1. I have 15 service plans. I know the key combination "copy - paste", but this is too much.
2. Changes in the config of service plans will not be affected on locked for editing subscriptions. For example, if I change the memory limit on the domain, his subscription will be impossible to change even if you change the service plan.
3. Because I'm changing sendmail_path in all domains, I, naturally, modified /etc/php.ini. Php.ini template for new domains is taken there, and the directives from (123.png) are added to it.
4. Most importantly, if I add here (123.png ) directive, which is already in the default php.ini, then plesk core NOT overwrite it, and add it as a new row. This will cause a crash the web server, followed by a denial of service.
 
Last edited:
Back
Top