Tag: PHP

Laravel Relation “Attempt to read property on null”

It usually means that the related record is NULL or soft-deleted. There are multiple ways to gracefully handle such a situation, without showing the error to the user. A practical example would be a list of Posts with belongs To relation to Categories. Migration file for Posts:

Continue reading

Magento server performance configuration

magento-server-perofrmance-setup

There are best practices in Magento 2 performance configuration of operating system, MySQL, PHP and webserver. This article covers important configurations of all components that will speed up the Magento site.

Continue reading

FreePBX error gui_hidden has a deprecated constructor

freepbx

Having fresh manual installation of FreePBX 14 on CentOS 7 and when access GUI for the first time it throws the following error: Methods with the same name as their class will not be constructors in a future version of PHP; gui_hidden has a deprecated constructor. In Apache’s error log file I found the following: …

Continue reading

How to upload a file to remote FTPS with cURL and PHP

You may need to upload a file to remote FTP or FTPS in a number of cases. In this article I’m going to show you how to upload file with cURL from Linux shell and using cURL in PHP.

Continue reading

How to Install PHP 7 in CentOS 7

The CentOS 7 official software repositories have PHP 5.4 that is reached end of life and no longer actively maintained by the developers. Thus you need a newer PHP 7 on your CentOS server. The commands below will help you install PHP 7 on CentOS. All of them are executed as root account or with …

Continue reading

Unable to set php_value soap.wsdl_cache_dir

I php-fpm access.log we can see the following: [18-Jan-2018 15:03:38] WARNING: [pool www] child 2148 said into stderr: “ERROR: Unable to set php_value ‘soap.wsdl_cache_dir’” By default this parameter looks like the following: php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache

Continue reading

Enable Apache event MPM with php-fpm

Choose-Apache-MPM-Module

Starting from version 2.4 Apache offers 3 MPM (Multi-processing Module) we can choose from, depending on your needs. The prefork MPM uses multiple child processes without threading. Each process handles one connection at a time without creating separate threads for each. Without going into too much detail, we can say that you will want to …

Continue reading