RSSAll Entries Tagged With: "PHP"

How to enable SuPHP ?

Issue :
How to enable SuPHP ?
Solution :
Login to WHM.
Go to “Service Configuration >> Apache Configuration >> Configure PHP and Suexec” and check if SuPHP is available in the drop down menu. If it is available then select it and save the configuration after a dry run.
SuExec should also be available in the same [...]

Security concerns in executing binary files

Issue :
An application requires execution of a binary file. A separate account has been created but do not want to turn on the exec() function citing security concerns. What is the best way to go about this ?
Solution :
If it is a php suexec server then you can place a custom php.ini file [...]

Compiling PHP5 with IMAP support on a LiteSpeed server

Tutorial on how-to compile php5 with imap support on a litespeed server
Step 1 : Install imap
Here are the required steps :
root@server []#cd /usr/src
root@server []#wget ftp://ftp.cac.washington.edu/imap/imap.tar.gz
root@server []#tar -xzvf imap.tar.gz
root@server []#cd imap-2007e
root@server []#make lfd
root@server []#mkdir /usr/local/imap
root@server []#cp -prf c-client/ /usr/local/imap

Step 2 : Recompile php with the options –with-imap=/usr/local/imap and –with-imap-ssl
Here are the steps for [...]

Upload failed despite having custom php.ini

Issue :
A 5 MB file cannot be uploaded via cPanel’s File Manager even though there is a custom php.ini in place with upload_max_filesize and post_max_size set to 10 MB.
Solution :
To alter the maximum file size for files uploaded via cPanel’s File Manager, you must use the following Tweak Setting in WHM:
WHM >> [...]

PHP 5.2.11 released !

The PHP development team has announced the release of PHP 5.2.11. This release comes with over 60 bug fixes . Some of these were security related as well. This release is intended to increase the stability of PHP 5.2.x.
Official release notes are available here .

Enabling the PHP extension–FreeType

Issue :
How to enable the PHP extension–FreeType on a server running cPanel/WHM and apache?
Solution :
You need to re-compile apache and php with freetype . This can be done via the command line or through WHM.
Command line :
Run /scripts/easyapache and select “ttf” for freetype.
WHM:
You can enable freetype via WHM >> software >> Apache [...]

Permission issues with suphp+suexec

Issue :
When migrating from a server NOT running suphp & suexec to a server running these, permission issues occur .
For example, directories which are chmoded to 777 would not be compatible.
Solution :
You can use the following commands to change the permissions :
find /home/*/public_html -type d -perm 0777 -exec chmod 755 {} [...]

Cannot upload unless permissions are set to 777

Issue :
WordPress installed on a cPanel server.
Cannot upload images using WP unless the “uploads” directory is set to “777″ which poses serious security threats.
Solution :
The reason is that WordPress is running PHP as a DSO (Apache Module) which insecurely runs all scripts commonly under the global username “nobody”.
Since your Wordpress application is [...]

500 error when using php_value/php_flag

Issue :
When trying to turn ‘register_globals’ ON by adding a statement “php_flag register_globals on ” in the .htaccess, following error appears on the website:
“A 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request”
Apache error log says:
.htaccess: Invalid command ‘php_flag’, perhaps mis-spelled or defined [...]

Logging in to PHPMyAdmin directly

Issue :
How to login to PHPMyAdmin directly (without logging in to the cPanel interface) ?
Solution :
This can be achieved by the following steps :
First, download and untar the latest version in to your public_html folder.
wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/2.11.9.5/phpMyAdmin-2.11.9.5-english.tar.gz
tar -zxvf phpMyAdmin-2.11.9.5-english.tar.gz
cd phpMyAdmin-2.11.9.5-english
mv phpMyAdmin-2.11.9.5-english phpMyAdmin
Then, create a file named config.inc.php and put the following entries in it [...]

Using multiple PHP versions

Issue :
How to install multiple versions of PHP and make one of them default? Also, how can the users choose the desired version?

Solution :
Installing and configuring concurrent PHP can be done by going to WHM -> Software -> EasyApache and when prompted for which version of PHP to run, select both PHP 4 [...]

Disabling PHP shell functions

Issue :
All PHP shell functions need to be stopped.
Solution :
1. Locate the php.ini file
php -i | grep php.ini
2. Open it with your favorite editor and put the following :
disable_functions = ” “
Or add functions that you want to disable.

Preserving httpd.conf during EasyApache

Issue :
The apache configuration file (httpd.conf) has several custom entries which should not be over-written when an EasyApache is done for recompiling/adding a PHP/Apache extension.
Solution :
Starting with cPanel 11.x, all the apache settings are also stored in a database and the configuration files are recreated each time an account is added or a [...]

“Fatal error: Allowed memory size of 8388608 bytes exhausted”

Issue :
Error: “Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 77824 bytes) in /home/ivonson/public_html/wp-content/plugins/revver/xmlrpc-2_2/xmlrpc.inc on line 2551″
Fix :
You need to adjust the value of ‘memory_limit’ accordingly. If you have ‘root’ access to the server then you can alter the value for ‘memory_limit’ :
1. Either by editing the server [...]

Fantastico is not installed at the default location

Issue :
Fantastico is not installed at the default location /usr/local/cpanel/3rdparty/fantastico. Either move the Fantastico directory from it’s current location to /usr/local/cpanel/3rdparty/fantastico OR enable ioncube loaders in WHM -> Tweak settings.
root@server [~]# cp -p /usr/local/cpanel/3rdparty/etc/php.ini /var/cpanel/3rdparty/etc/php.ini
cp: cannot create regular file `/var/cpanel/3rdparty/etc/php.ini’: No such file or directory
Solution :
1. Try updating cPanel to the latest version.
2. [...]

Get Adobe Flash playerPlugin by wpburn.com wordpress themes