• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Using custom php.ini for Php in FastCGI mode per-domain

ProWebS

Regular Pleskian
Hello,

I did follow the instructions here http://kb.odin.com/9059
in order to use custom options in a php.ini for a domain running FastCGI.

the problem is that after I did everything described, and restared apache, still the vhost didnt run withe the php options at /var/www/vhosts/mydomain.tld/conf/php.ini

and while I was refreshing the website I took a look at "top" command and saw this:

31167 "vhostname" 15 0 152m 10m 6160 S 0.3 0.1 0:00.03 /usr/bin/php-cgi -c /etc/php.ini

so its all clear that still apache and fascgi is using /etc/php.ini and not /var/www/vhosts/mydomain.tld/conf/php.ini

why is that?
 
ok I've found what it was wrong, it was the permissions of the php.ini file, the correct ones are:

-rw-r--r-- php.ini

now it's working great.
 
what about subdomains with sep. php.ini

Hello Forum

The instruction in kb 9059 from parallels work great for me (Plesk 9.5.4 / Lenny 64bit / PHP 5.2.6) for every domain.

My Problem are still the subdomains.

If I change the php-mode from "apache" to "fast-cgi" for a subdomain and do the same things with the php.ini and the conf-folder for a subdomain the only thing I receive is the following error:

No Input file specified


Same thing even without own php.ini-file.


Does anybody know how to fix this, so that I am able to run fast-cgi in a subdomain with or without own php.ini-file?

Thanks in advance!

Greetings from Switzerland
Andrew
 
Hello Forum

After searching the internet about the fastcgi with custom php.ini for subdomains without success, I found myself a way to do this:

My System:
Plesk 9.5.4 / Lenny 64bit / PHP 5.2.6


1)
Modified the file cgi_wrapper (found under /var/www/cgi-bin/cgi_wrapper) as follow:

#!/bin/sh

domain=`grep ":$UID:" /etc/passwd | cut -d: -f6`

PHPRC=$domain/conf/php.ini

[ -f ${PHPRC} ] || PHPRC="/etc/php.ini"

export PHPRC
exec /usr/bin/php-cgi -c "$PHPRC"


2)
Create a separate ftp-user for the subdomain


3)
chmod the conf-directory under the subdomain-path to 0755


4)
Copy a php.ini-file to the conf-directory of the subdomain and modify this file to your needs.


5)
Let plesk reconfigure the hole vhost.
This step is perhaps not really necessary, but I do it with

/opt/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=domain.tld


6)
restart the apache


From here on, it work like a charme for the maindomains and the subdomains, even if a maindomain has php as apache-module and its subdomains has php as fastcgi with a custom php.ini

For a secondary subdomain or a subdomain from another maindomain you just need to follow the steps 2-6.

Greetings from Switzerland
Andrew
 
Back
Top