Top Nav

Archive | Scripting

Using PHP composer.phar With Non-default PHP Install

Composer for PHP is an increasingly popular tool for managing packages within a PHP application.  Here’s a link for more information:

https://getcomposer.org/

On many of our Plesk servers we have multiple PHP versions install. The default at /usr/bin/php is provided by the Linux distribution and then there are additional version installed at /opt/plesk/php. Plesk lets us easily select the PHP version for each hosted website. But you can run into problems with composer using the wrong PHP version. A typical composer command might be:

or

To make our alternate PHP version work we need to instead do something like this:

So we override the default PHP by adding our preferred version to the front of the path.

1

Apache2 With mod_fcgid On CentOS 6.2

Need mod_fcgid on a CentOS 6.2 or similar server? Check out this great how-to:

https://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-centos-6.2

I especially like the use of suexec.

This howto worked on the first try! There are not many actual working mod_fcgid howtos!

One issue that I did run into is the default MaxRequestLen is 131768 which is way to low so had to add this line:

to /etc/httpd/conf.d/fcgid.conf.

 

0

Disable PHP zlib.output_compression

If you need to disable zlib output compression from the .htaccess file, then just add the following line to the top of the file:

 

1

maxclients.sh Script For Apache

This script attempts to look at Apache memory usage and recommend a stable setting for MaxClients.

 

0