In this article, you will learn how to resolve the issue of invalid php.ini usage for Plesk LSAPI domains.
Issue:
- An invalid php.ini is being used for domains with Mod LSAPI PHP handlers in Plesk.
- Instead of using the Plesk php.ini located at /var/www/system/domain.tld/etc/php.ini, the default php.ini from “PHP selector” is used.
- The PHP selector cannot be configured for newly created Plesk subscriptions, showing “No selector dir for user XXX.”
Cause:
Corrupted “alt-python27-cllib” package.
Solution:
- Check alt-python27-cllib Package Integrity:
If the output differs from the example below, proceed with the next steps:# rpm -V alt-python27-cllib S.5....T. /opt/alt/python37/lib/python3.7/site- packages/clcommon/cpapi/apilink.py S.5....T. /opt/alt/python37/lib/python3.7/site-packages/clcommon/cpapi/cache/__init__.py S.5....T. /opt/alt/python37/lib/python3.7/site-packages/clcommon/cpapi/cache/__pycache__/__init__.cpython-37.opt-1.pycS.5....T. /opt/alt/python37/lib/python3.7/site-packages/clcommon/cpapi/cache/__pycache__/__init__.cpython-37.pyc ........P /usr/share/python-cllib/cl.captain
- Reinstall the RPM Package:
# yum reinstall alt-python27-cllib
- Reconfigure Plesk PHP Handlers:
# plesk db -Ne"select name, h.php_handler_id from domains d, hosting h where d.id=h.dom_id" | while read a b; do plesk bin domain --update $a -php_handler_id $b; done
- Reconfigure “PHP selector” for Each User:
# grep vhost /etc/passwd | awk -F":" '{print $1}' | while read i; do selectorctl --user-current --user=$i | cut -f1 | while read a; do selectorctl --set-user-current=$a --user=$i; done; done
That is it!