Custom php.ini help


#1

i’ve followed the instructions here:

And the result displaying on my website is:
#!/bin/sh exec /dh/cgi-system/php5.cgi

cant understand why… please help?


#2

[quote]i’ve followed the instructions here:

And the result displaying on my website is:
#!/bin/sh exec /dh/cgi-system/php5.cgi

cant understand why… please help?[/quote]
That page needs a little work. There are two ways for Apache to run PHP - CGI and FastCGI.

If you don’t want to run it as FastCGI, change the extensions in .htaccess and the wrapper to .cgi instead of .fcgi

Otherwise login to the Web Panel and go to Domains -> Manage Domains. “Edit” the domain to enable FastCGI support.

Customer since 2000 :cool: openvein.org


#3

Yeah i didnt have fast cgi enabled. Just found that out.
But its still not working. I am waiting for support to get back to me, but…

now that fast cgi is enabled, and i follow everything in the wiki… should it then work? Or is there now another discrepancy occurring?


#4

[quote]Yeah i didnt have fast cgi enabled. Just found that out.
But its still not working. I am waiting for support to get back to me, but…

now that fast cgi is enabled, and i follow everything in the wiki… should it then work? Or is there now another discrepancy occurring?[/quote]

You shouldn’t be seeing the contents of php5-wrapper.fcgi

Try this test. Rename your domain directory to something like “example.com-backup” so we can start new for now. Make sure you don’t have an .htaccess file in your home directory as well.

Make the directories again and copy php.ini -$ mkdir ~/example.com $ mkdir ~/example.com/cgi-bin $ cd ~/example.com/cgi-bin$ cp /etc/php5/cgi/php.ini php.ini

Now we use an editor to make a wrapper script:

[code]$ nano dispatch.fcgi

— dispatch.fcgi —
#!/bin/bash
export PHP_FCGI_CHILDREN=2
exec /dh/cgi-system/php5.cgi
------[/code]Set the permissions:$ chmod 755 dispatch.fcgi $ chmod 640 php.iniNow we don’t have an .htaccess or PHP script yet. We should be able to browse to http://example.com/cgi-bin/dispatch.fcgi and see the wrapper script source, and http://example.com/cgi-bin/php.ini should give a Forbidden error.

Let’s make a simple PHP script now:

[code]$ nano ~/example.com/phpinfo.php

— phpinfo.php —

<?php phpinfo(); ?>

------[/code]Ok if you browse to http://example.com/phpinfo.php you should get the information page. And since we don’t have an .htaccess yet it should be loading the configuration file from /etc/php5/cgi/php.ini

Let’s make our .htaccess now:[code]$ nano ~/example.com/.htaccess

— .htaccess —
AddHandler php5-cgi .php
Action php-cgi /cgi-bin/dispatch.fcgi
Action php5-cgi /cgi-bin/dispatch.fcgi
------[/code]Now if we browse to http://example.com/phpinfo.php it should indicate it is loading the configuration file from /home/.glob/username/example.com/cgi-bin/php.ini

Customer since 2000 :cool: openvein.org


#5

Or use the auto-installer.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost