• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • Debian 11 has reached its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.81 is the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

How to disable php functions on per vhost level?

T

Traged1

Guest
How can one disable php functions on a per vhost level?

I have added to the vhost.conf file the following:

<Directory /home/httpd/vhosts/domain.com/httpdocs>
php_admin_value disable_functions fsockopen,pfsockopen,socket_create,socket_bind,socket_connect,socket_listen,socket_create,socket_strerror,fsocket
</Directory>

Then I used:

/usr/local/psa/admin/sbin/websrvmng -a -v

But it still allows the fsockopen(); in php for this vhost?

Is this possible to do or do I not have the correct syntax?

The reason I am doing this is to prevent customers from using thier own php sendmail programs and opening massive amounts of socks which leads to apache crashes with the [crit] too many files open error.

I can't disable the functions in php.ini because then webmail cannot send any email.

Alternatively, I would appreciate if anyone knows how I can designate a different php path for webmail?
 
disable_functions is only server-wide function. You can't enable or disable it for one vhost.
 
Then is there a way to change the location of the PHP which webmail uses?

It currently uses:
/usr/bin/php

Where I would like it to use:
/usr/local/psa/admin/bin/php
 
Hello.
Just curious,
Did you try turning it off in the hosting setup menu?

If I understand your question correctly, this should take care
of it.

Cheers.
 
Back
Top