Archive for the tag 'PHP'

Using hardening tools Suhosin in Cpanel Servers for PHP

The Suhosin extension “was designed to protect servers and users from known and unknown flaws in PHP applications and the PHP core.”

Reference : http://www.hardened-php.net/suhosin/

Perhaps more importantly, the Suhosin community would be an excellent starting point for learning about flaws in PHP, as well as other extensions, configurations, and techniques you can use to protect your server.

Since many popular scripts are not compatible with Suhosin’s restrictions, you need to test it before moving to production.

SBDavid

Apache PHP Request Handling in Cpanel

Apache PHP Request Handling in Cpanel

Cpanel PHP’s main configuration file is located at /usr/local/apache/conf/php.conf
The php.conf file is called by the Apache configuration file (httpd.conf) by means of an include command.

WHM provides an interface that can assist you in configuring PHP. It is located in Service Configuration >> Apache Configuration >> PHP and SuExec Configuration. You are also able to access a command line interface that provides the same options through the following script:

/usr/local/cpanel/bin/rebuild_phpconf

Reference: http://cpanel.net

SBDavid

Recompile php in DirectAdmin

Recompile php in DirectAdmin

If you run into problems after Adding custom modules to apache for customapache, you may also need to recompile php as well:

cd /usr/local/directadmin/customapache

and then

./build php

Then restart apache:

/sbin/service httpd restart

And for FreeBSD:

/usr/local/etc/rc.d/httpd restart

Source : http://directadmin.com

For apache 2.0 use the following methods.

cd /usr/local/directadmin/customapache
./build clean
rm -f configure.*
./build update
./build update_data_ap2
./build apache_2
./buld php_ap2 n
./build mod_perl_ap2

Once the update has completed, you’ll need to restart apache:

/sbin/service httpd restart

Swapping between php versions when using suPHP and CLI with custombuild

If you have both suPHP and CLI installed on your system, but don’t feel like renaming all of your file.php to file.php4 (for example), there is another means to chose between php versions, without requiring to touch your php files.

To force php files to use suPHP (on the assumption your default php version uses CLI) use the following:

<FilesMatch “\.php$”>
AddHandler x-httpd-php5 .php
</FilesMatch>

This last one is on the assumption that php 5 is suPHP and CLI is php4. If php4 was suPHP, then you’d use x-httpd-php4 to force .php files to use suPHP with php 4.

Source: http://directadmin.com/

« Prev - Next »