Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Tuesday, April 12, 2011

Install PHP APC on RHEL and CentOS

Install prerequisites: (note that on RHEL you need to enable the Optional server repo for php-devel, rhn-channel --add --channel=rhel-x86_64-server-optional-6)
yum install gcc php-pear php-devel httpd-devel pcre pcre-devel

Install APC with pear:
pear install pecl/apc

Tell PHP to load the APC module. Create /etc/php.d/apc.ini
echo "extension=apc.so" > /etc/php.d/apc.ini

Restart Apache

Thursday, March 26, 2009

PHP: Getting the username logged in with .htaccess

If you are using .htaccess Apache Auth and you need to get the name of the logged in user:

echo $_SERVER["REMOTE_USER"];

Monday, March 16, 2009

PHP: Echo all $_POST data

foreach($_POST as $var => $value)
{
echo $var . ' : ' . $value . "<br>";
}