Set PHP settings trough cPanel API
Forum
  1. Forums
  2. CloudLinux and Control Panels
  3. CloudLinux and cPanel
  1. Morten
  2. Saturday, 21 December 2019
  3.  Subscribe via email
Hello,

whmapi1 php_ini_set_directives directive-1=max_execution_time%3A360 version=alt-php74
This works fine.
But as long as we include a M/G like below it will not work:
whmapi1 php_ini_set_directives directive-1=memory_limit%3A756M version=alt-php74

But if we use it on a ea-php version it works just fine.
Could you fix it or talk to cPanel and make them fix this bug? :D

Or do you have easier way to change these PHP settings for all PHP versions?
Rate this post:
  1. 23.12.2019 16:12:07
  2. # 1
Sergey Khristich Accepted Answer
Posts: 344
Joined: 20.05.2019
0
Votes
Undo
Hello Morten,
Could you check again please? On our test server this bug is not played:

[[email protected] ~]# grep ^memory_limit /opt/alt/php74/etc/php.ini
memory_limit = 2G
[[email protected] ~]# whmapi1 php_ini_set_directives directive-1=memory_limit:128M version=alt-php74
---
data: {}
metadata:
command: php_ini_set_directives
reason: OK
result: 1
version: 1
[[email protected] ~]# grep ^memory_limit /opt/alt/php74/etc/php.ini
memory_limit = 128M

You can try an alternative way to change this: the file edit directly /opt/alt/php74/etc/php.ini or use this guide here https://docs.cloudlinux.com/cloudlinux_os_components/#configuring-global%E2%80%9D-php-ini-options-for-all-alt-php-versions
If the problem persists, you can create a ticket here https://cloudlinux.zendesk.com/hc/en-us/requests/new and our technical experts will help you.
Thank you.
Marketing Manager
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.