Install PHP 5.6 on CentOS 7

To install PHP 5.6 on CentOS 7, enable EPEL repo and remi repo

Install yum-utils and enable remi-php56 repo

Install PHP 5.6 with

[…]

Read More…

HTTP 301 Redirect using PHP

php programming

You can use PHP header() function to do redirect. To do 301 redirect, use

For 302 redirect, use

If you need to redirect a site to new site keeping same URL structure, you can use

[…]

Read More…

CloudLinux PHP Selector on Cpanel Server

CloudLinux come with PHP Selector, this allow you to select differnt PHP versions. When you enable PHP selector, you should do the following.

Related Posts Enable CloudLinux PHP lsapi CloudLinux […]

Read More…

CentOS 7 VestaCP Upgrade PHP to 7.x

On CentOS 7 VestaCP install PHP 5.6 by default. This is very old version of PHP. To upgrade PHP to latest version 7.x, you can install remi repo. Install EPEL repo

Install yum-utils

Install remi repo

Select PHP version you need

Here i selected PHP 7.3. You can select differnt PHP […]

Read More…

Install PHP 7.3 in CentOS 8

CentOS 8 comes with PHP 7.2. To install PHP 7.3, you need to enable remi repo. You can download remi-release rpm file from http://rpms.remirepo.net Download and install remi-release rpm

if you have older php version and don’t want to keep it, uninstall it with

Install PHP 7.3

Set it as default PHP […]

Read More…

Redirect a site to HTTPS using PHP

This PHP script will redirect web site visitor to HTTPS (SSL) url. You can add this in your index.php of the web site

Move a site to new URL using PHP

You can also use Apache mod_rewrite .htacess to do the redirection. […]

Read More…

Large file upload in PHP

To allow large file upload in PHP, you need to edit php.ini file and change fllowing settings

If you have Dedicated or VPS, you can edit php.ini file using ssh. To find location of this file, upload a phpinfo page to your server, that will display location of php.ini used by your web site. […]

Read More…