Php 4 on cpanel

Here are a few articles that mention it:

https://documentation.cpanel.net/display/EA/Custom+Modules
https://forums.cpanel.net/threads/how-to-easy-php4-php5-side-by-side-after-removal-of-php4-from-easyapache.304942/

The End of PHP 4


https://www.siteground.com/kb/how_to_have_different_php__mysql_versions/

You can set the handler for the site using a .htaccess file in the domains webroot with the following contents:
Code:
AddHandler application/x-httpd-php4 .php .php4 .php3

Percona with cPanel: libmysqlclient.so.18: cannot open shared object file

A recent Percona upgrade caused problems with PHP on some cPanel servers. The name of the libmysqlclient library was changed without keeping a symlink to the original name, which caused PHP to throw errors, and EasyApache not compiling successfully.

Running php -v will show it…

php -v
php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

From the Percona Server 5.5.36-34.0 Release Notes: https://my.fusioned.net/knowledgebase/10100/Percona-with-cPanel-libmysqlclientso18-cannot-open-shared-object-file.html

In order to comply with Linux distribution packaging standards Percona‘s version of libmysqlclient has been renamed to libperconaserver. The old name was conflicting with the upstream libmysqlclient. Except for packaging, libmysqlclient and libperconaserverclient of the same version do not have any differences. Users wishing to continue using libmysqlclient will have to install the corresponding package of their distribution, such as mysql-lib for CentOS and libmysqlclient18 for Ubuntu/Debian. Users wishing to build software against libperconaserverclient should install libperconaserverclient-dev package. An old version of Percona-built libmysqlclient will be available for download.

You simply need to symlink libperconaserver to libmysqlclient, and here’s how it’s done:


# ln -s /usr/lib64/libperconaserverclient.so /usr/lib64/libmysqlclient.so
# ln -s /usr/lib64/libperconaserverclient.so.18 /usr/lib64/libmysqlclient.so.18

(Note: for RHEL/CentoOS/CL 6 x86, replace /usr/lib64 with /usr/lib)

Finally, re-run EasyApache to compile PHP against the new libraries:


# /scripts/easyapache --build

Note: After running this, this error appeared on php sites…


ERROR: Database Error: The MySQL adapter "mysql" is not available.

Checked and the symlinks were not real as there were missing files.

Check perconal rpm’s

rpm -qa |grep PerconaPercona-Server-shared-compat-5.5.35-rel33.0.611.rhel5
Percona-Server-shared-56-5.6.16-rel64.0.el5
Percona-Server-client-56-5.6.16-rel64.0.el5
Percona-Server-devel-56-5.6.16-rel64.0.el5
Percona-Server-server-56-5.6.16-rel64.0.el5

I removed the symlinks and applied

Removed the symlinks and then followed this cpanel article symlink at the bottom to rebuild.

Another resource:
https://documentation.cpanel.net/display/CKB/How+to+Replace+MySQL+with+Percona

Cpanel Documentation
https://documentation.cpanel.net/display/CKB/How+to+Update+a+Percona+Installation

PhalconPHP

Installation

Clone this repository into /var/cpanel/easy/apache/custom_opt_mods/ like so:


# cd /var/cpanel/easy/apache/custom_opt_mods/
# git clone https://github.com/thecpaneladmin/EA-PhalconPHP.git .
# /scripts/easyapache

Git on cpanel is at

# /usr/local/cpanel/3rdparty/bin/git

Or use the .zip:


# cd /usr/src
# wget https://github.com/thecpaneladmin/EA-PhalconPHP/archive/master.zip
# unzip -d /var/cpanel/easy/apache/custom_opt_mods/ master.zip
# /scripts/easyapache

Make sure that the path is


/var/cpanel/easy/apache/custom_opt_mods]# ls -la

drwxr-xr-x 4 root root  4096 Sep  2 20:26 ./
drwxr-xr-x 9 root root  4096 Sep  2 20:38 ../
drwxr-xr-x 3 root root  4096 Sep  2 20:26 Cpanel/
-rw-r--r-- 1 root root   606 Sep  2 20:32 error_log
drwxr-xr-x 7 root root  4096 Sep  2 20:26 .git/
-rw-r--r-- 1 root root 18025 Sep  2 20:26 LICENSE
-rw-r--r-- 1 root root   834 Sep  2 20:26 README.md

Or it will not show up in easy apache.

From here, select Phalcon from the list of PHP modules. The module will be loaded from /usr/local/lib/php.ini.

How do I change maximum email size in cPanel?

There is no max file size limit that can be sent and received, however, cPanel defaults the limit to 50mb. You can change this in cPanel.

To change this do the following,

Login to cPanel as admin
Under Service Configuration, Click “exim Configuration Manager”
Click “Advanced Editor”
Scroll down and Click “Add additional Configuration Setting”
Find “message_size_limit” in pull-down list and choose
Enter limit that you want to change to
Scroll to bottom and click “save”

Email Alerts for Pureftpd on WHM

WHM show the service as down.


Server domain.com
Primary IP Address 69.xx.xx.xx
Service Name ftpd
Service Status failed
Notification The service ?ftpd? appears to be down.
Service Check Method The system?s command to check or to restart this service failed.
Number of Restart Attempts 258
Startup Log 

Do the following…

# cd /var/run
# mv pure-ftpd.pid pure-ftpd.pid.bk

Restart ftpd in WHM under Service

Cpanel errors

[Tue Aug 18 16:28:04 2015] [error] [client 65.47.199.226] ModSecurity: Audit log: Failed to create subdirectories: /usr/local/apache/logs/modsec_audit/exclusi3/20150818/20150818-1628 (Read-only file system) [hostname "exclusivityllc.net"] [uri "/index.php"] [unique_id "VdOjZNg3iukAAFLEtGYAAAAH"]
If I disable mod security on the account, then I get Mod ruid errors

Disable mod security


[Tue Aug 18 16:29:49 2015] [error] [client 209.92.131.130] SecurityException in Application.cpp:186: Do not have root privileges. Executable not set-uid root?
[Tue Aug 18 16:29:49 2015] [error] [client 209.92.131.130] Premature end of script headers: index.php

I had to disable modsecurity and then uncheck “EXPERIMENTAL: Jail Apache Virtual Hosts using mod_ruid2 and cPanel® jailshell” enabled under the “Security” tab in “WHM >> Tweak Settings”.