ukritie.org.ua

  • Увеличить размер шрифта
  • Размер шрифта по умолчанию
  • Уменьшить размер шрифта
Добро пожаловать, Гость
Логин: Пароль: Запомнить меня

Individual php.ini files for PHP FCGI and PHP CGI
(1 чел.) (1) гость
  • Страница:
  • 1

ТЕМА: Individual php.ini files for PHP FCGI and PHP CGI

Individual php.ini files for PHP FCGI and PHP CGI 20.07.2011 08:40 #302

  • pro
  • Вне сайта
  • Заблокирован
  • Постов: 164
  • Репутация: 2
Since I figured these might be helpful to people running either FCGI or CGI handlers on PHP, I\'m going to post my guides that I have on my own forum here. If this is in the wrong spot for such guides, please feel free to move them. I hope these will be helpful

PHP FCGI Individual php.ini File

The following steps will allow a custom php.ini file on an account when using FCGI as the PHP handler.

Copy and Edit default php.ini

cd /home/user/public-html/cgi-bin
cp /usr/local/lib/php.ini /home/user/public_html/cgi-bin
vi php.ini


As a test change one of the variables like register_globals from:


register_globals = Off

To:

register_globals = On


If yours was On, then do the reverse. This is simply to test it changes from the global php.ini file.

Create php.fcgi file to load custom php.ini


vi php.fcgi


Please note that you should still be in /home/user/public_html/cgi-bin location.

Put into file:

Code:
#!/bin/sh
export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=10
exec /usr/local/cpanel/cgi-sys/php5
Please note the path to php5 is due to using PHP5 on this system. If you are using php4, it might be /usr/local/cpanel/cgi-sys/php4 or some other path. Check /etc/httpd/conf/php.conf to see what it shows for cgi-sys path for your version of PHP.

Save file, then made executable:

Code:
chmod +x /home/user/public_html/cgi-bin/php.fcgi
Change ownership of files to correct user:

Code:
chown -R user:user /home/user/public_html/cgi-bin/
Edit .htaccess to point to php.fcgi wrapper

Code:
cd /home/user/public_html
vi .htaccess
Put at top of file:

Code:
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php.fcgi
Again, here php5 is listed.
экономьте электричетсво - выключайте Num Lock!

PHP CGI Individual php.ini File 20.07.2011 10:28 #303

  • pro
  • Вне сайта
  • Заблокирован
  • Постов: 164
  • Репутация: 2
The following steps will allow a custom php.ini file on an account when using CGI as the PHP handler.

Copy and Edit default php.ini


cd /home/user/public-html/cgi-bin
cp /usr/local/lib/php.ini /home/user/public_html/cgi-bin
vi php.ini


As a test change one of the variables like register_globals from:


register_globals = Off


To:

register_globals = On


If yours was On, then do the reverse. This is simply to test it changes from the global php.ini file.

Create php.cgi file to load custom php.ini


vi php.cgi


Please note that you should still be in /home/user/public_html/cgi-bin location.

Put into file:


#!/bin/sh
/usr/local/cpanel/cgi-sys/php5 -c /home/user/public_html/cgi-bin/


Please note the path to php5 is due to using PHP5 on this system. If you are using php4, it might be /usr/local/cpanel/cgi-sys/php4 or some other path. Check /etc/httpd/conf/php.conf to see what it shows for cgi-sys path for your version of PHP.

Save file, then made executable:

chmod +x /home/user/public_html/cgi-bin/php.cgi


Change ownership of files to correct user:


chown -R user:user /home/user/public_html/cgi-bin/


Edit .htaccess to point to php.cgi wrapper


cd /home/user/public_html
vi .htaccess


Put at top of file:
Action application/x-httpd-php5 /cgi-bin/php.cgi


Again, here php5 is listed. If your PHP is different, use the Action listed for your version of PHP in /etc/httpd/conf/php.conf file.

Load phpinfo page on account


cd /home/admin/public_html
vi php.php


In file put:


<?php
phpinfo();
?>

Change ownership to the user:

Code:
chown user:user php.php
Load the file at domain.com/php.php to see the results.

Your phpinfo file should now show register_globals changed as well as have this at the top defining the new php.ini path:

Code:
Loaded Configuration File /home/user/public_html/cgi-bin/php.ini
экономьте электричетсво - выключайте Num Lock!
  • Страница:
  • 1
Время создания страницы: 0.20 секунд

НОВОЕ НА ФОРУМЕ

Нет сообщений для показа


Поиск

Календарь

Праздники Украины