Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm on shared server environment (Dreamhost.com uses Linux/Debian).

I followed their instructions here on setting up a local PHP5 instance on my user account so that I could use APC (php5 accelerator)

A caveat is that I don't have php5 installed on the root directory "/home/php5" as assumed by the instructions/install script.

Rather I have it in another directory "home/subdir-path/php5", so I had to change the script to address that.

I tried adding this dir to the env $PATH

but when I do phpinfo(), I see that it's not using the local php.ini settings =[

Any thoughts on how to remedy this is greatly appreciated.

==OR==

If someone could show me the right steps to set up a custom php5 instance, with fastcgi, and APC (php cache/accelerator) that'd be just as great.

share|improve this question

3 Answers 3

I've never worked with DreamHost before but looking at the wiki page you referenced and taking into account the version difference of the php-update.php script (0.1.4 vs 0.1.7) in Step 4 it would appear they require you put your necessary INI changes in the $inimodifications array found on line 73.

// Modifications to be made to the ini file after it is updated
// - If you need to change these then you can do so here, then
//   delete your target ini files and run the script again
$inimodifications = array(
    'output_buffering = 0',
    'post_max_size = 100M',
    'upload_max_filesize = 100M'
);

Considering output_buffering, post_max_size & upload_max_filesize are all options found in the php.ini file I would start with trying to add the necessary lines you're neededing to change to this array following their examples and try again.

share|improve this answer

Revise the instructions in Step 4 as here:

touch ~/subdir-path/php5/php-update.php

And change this section of the script to include "subdir-path" (this script will be the one referenced by the touch command and should include the complete script as listed in the instructions):

// Determine the version of PHP to update (4 or 5) based on the directory
$directories = explode('/', dirname(__FILE__));
$directories = array_reverse($directories);
$directory = $directories[0];

switch ($directory) {
    case 'php':
        $php = 'php';
        break;
    case 'php5':
    default:
        $php = 'php5';
        break;
}

// The full paths to the source cgi and ini
$sourcecgi = '/dh/cgi-system/' . $php . '.cgi';
$sourceini = '/etc/' . $php . '/cgi/php.ini';

// Get the HOME environment variable
$home = $_SERVER['HOME'];

// The full paths to the target cgi and ini
$targetcgi = $home . '/' . 'subdir-path' . $php . '/' . $php . '.cgi';
$targetini = $home . '/' . 'subdir-path' . $php . '/php.ini';

Also, in Step 8, make sure you make those alias(es) to your custom directory, for example:

cd ~/example.com
ln -s ~/subdir-path/php5 .

You may also need to amend the pathnames in your .htaccess file(s).

share|improve this answer
    
actually this did not answer my question –  qodeninja Oct 6 '09 at 6:54
up vote 0 down vote accepted

To do this I had to create an fcgi wrapper..

you can pretty much name it whatever you want

touch php5-mywrapper.fcgi

make it executable

chmod +x php5-mywrapper.fcgi

write to the file =]

pico php5-mywrapper.fcgi

    #!/bin/sh
    export PHP_FCGI_CHILDREN = 3
    exec cgi-bin/php5.fcgi -c path/to/php-ini-dir/

then i added the appropriate handlers in the .htaccess file, and places the .htaccess file in the directory of the domain that is using the fcgi

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.