How to install PHP from Source on Ubuntu

Compiling PHP from source code can be essential when you require a specific PHP version that isn’t available through your Ubuntu distribution or a Personal Package Archive (PPA). This approach is particularly useful if you need to enable custom modules, such as pcntl, which is disabled by default on Ubuntu. By compiling PHP yourself, you … Read more

How to get Contents of a Webpage using PHP curl

PHP cURL module allows you to connect to remote websites and API endpoints to exchange data. To see if you have php-curl enabled, you can check phpinfo() page or run the command “php -m’ and look for curl. boby@sok-01:~$ php -m | grep curl curl boby@sok-01:~$ If php-curl module is not installed, you can install … Read more

How To Install ionCube on Ubuntu 20.04

ionCube is PHP extension that is used to load ionCube encoded PHP files. ionCube is used to protect commercial PHP scripts by encoding it, so no one can read the actual PHP code. First, download ioncube loader from https://www.ioncube.com/loaders.php cd /usr/local/src wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz tar xvf ioncube_loaders_lin_x86-64.tar.gz cd ioncube/ Find extension directory and copy .so file … Read more

How to install PHP PECL Extension

PECL is a repository for PHP extensions. To install PHP extensions from PCEL, you can use the command pcel install EXTENSTION_NAME_HERE To install a specific version, you can specify version after extension name as follows. pecl install pecl_http-3.2.3 Once an extension is installed, you need to edit PHP configuration and add a line to load … Read more

Monitoring APCu with APCu Panel

apcu-panel provide GUI to monitor APCu cache. To install apcu-panel on CentOS, run yum install apcu-panel The package provides following files [root@localhost ~]# rpm -q –filesbypkg apcu-panel apcu-panel /etc/apcu-panel apcu-panel /etc/apcu-panel/conf.php apcu-panel /etc/httpd/conf.d/apcu-panel.conf apcu-panel /usr/share/apcu-panel apcu-panel /usr/share/apcu-panel/index.php [root@localhost ~]# To enable GUI, edit file vi /etc/httpd/conf.d/apcu-panel.conf Modify it as follows # APC Control Panel Alias … Read more

NextCloud APCu not available for local cache

nextcloud dashboard

When trying to upgrade nextcloud, I get the following error www-data@mail:/www/nextcloud$ php7.3 occ upgrade An unhandled exception has been thrown: OC\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?) www-data@mail:/www/nextcloud$ To fix this, you need to install APC cache. apt install php7.3-apcu For CLI, you need to … Read more

Codeigniter 3 session not working

On a web application, session not working. I verified PHP session is working with script https://gist.github.com/serverok/8c504205ae0357e0c6488eab880a77bf When refreshing the script, the number start increasing, that confirms PHP session works fine on the server. As for Codeigniter, we need to check the session settings in file application/config/config.php $config[‘sess_driver’] = ‘files’; $config[‘sess_cookie_name’] = ‘ci_session’; $config[‘sess_expiration’] = 7200; … Read more