PHP 7.4 is now available.

We are excited to announce the availability of PHP 7.4 to all HelpingHost.com customers.

The PHP team recently announced the availability of PHP 7.4.
A jump from PHP 7.3 to 7.4, as usual, is a big step.

We have two groups of users.

1) End users who are using only using applications that need PHP to run.

2) Developer users who use PHP for applications they wrote themselves.

If you are an End User, please do NOT switch to PHP 7.4 for your application unless you have verified that the application runs with PHP 7.4.
The PHP team still supports PHP 7.3 with security patches and bug fixes. So, no need to hurry.
(besides, please remember that we are running Hardened PHP back to PHP 5.6 which means that our PHP Vendor backports patches to old PHP versions)
An important thing to consider that at the time of this article, IonCube Loader is NOT yet available for PHP 7.4.

 

Let me address WordPress, which is the most widely used PHP application with our customers.

WordPress 5.3 IS compatible with PHP 7.4. HOWEVER, there are more moving parts you have to check. Check that all your WordPress Plugins are PHP 7.4 compatible. Ensure that your template is PHP 7.4 compatible.

If you accidentally switched your site to PHP 7.4 and it stopped working, change it back to PHP 7.3, wait for 5 minutes, and it should be back online.

Keep in mind, you can always contact our support team with questions regarding this or to fix any issues you might encounter.

 

If you belong to the developer users group, you probably know to check the PHP 7.4 migration instructions on how to adjust your PHP apps.

PHP 7.3 Hosting released and now available for you to use.

PHP 7.3 Hosting released and now available for you to use.

PHP 7.3 Hosting is now available to any of your websites.

We have just completed the distribution of PHP 7.3 on all our Servers.
You now have the option to choose PHP 7.3 from inside your control panel.
Setting PHP 7.3 for any of your websites is obvious. See Screenshot.

However, we also have the option to setup PHP 7.3 hosting in any folder of your website.
So, if you would like to test PHP 7.3 in a sub folder, let us know and we can set this up for you.

One of the PHP applications that is already compatible with PHP 7.3 is WordPress 5.0.
It also was released recently and is available to you via our one click installer as usual.

Enjoy playing with PHP 7.3 and let us know if you run into any trouble.

PHP 7.3 Hosting Selector

Securing and updating HSphere PHP using CloudLinux

With the recent Joomla exploit it became even more clear that we hsphere hosters have to find a way to get the latest PHP versions onto our servers.
We are using CloudLinux on every web server already to take advantage of its ability to keep customers resource usage in check.
CloudLinux also comes with alternative PHP packages (alt-php) including hardened PHP which are EOL php versions that the CloudLinux team keeps patching.


For several weeks we researched ways to use the alternative PHP packages as replacements for hsphere PHP.
Good news! We did it!
Before we go into detail on how this was accomplished, please keep in mind our hsphere web setup before any changes are made:

  • – Apache 2 worker mode
  • – FCGID active
  • – mod_hostinglimits active
  • – CloudLinux 5 with Hybrid Kernel (CL6 will work just as well)

Now on to how we accomplished the goal of replacing hsphere PHP with Cloudlinux PHP.
At first we tried to get a custom suexec from CL to replace the hsphere suexec. However, under hsphere, the pathnames to all PHP binaries are actually hardcoded into the suexec. So, a custom suexec with just adjusted parameters will NOT work.

Next, we decided to try to litterally replace the hsphere php binaries with cloudlinux binaries.
This turned out to work pefectly well even though sadly cagefs will not work within PHP scripts due to the missing custom suexec.

Here are the steps:

  • yum install cagefs lvemanager -y
  • yum groupinstall alt-php -y
  • yum install alt-php54-zend-guard-loader -y (only on CL5)
  • /usr/sbin/cagefsctl –init
  • Now copy the sample PHP ini files from one user to /etc. Reason is that under Hsphere, the suexec does not respect cagefs which means php is looking for the php.ini in /etc/cl.php..
    cp -r /var/cagefs/00/[SAMPLEUSER]/etc/cl.php.d /etc/
  • edit the global php ini file to your liking: /etc/cl.selector/global_php.ini. What you add here will be compiled into each global php.ini in the next step
  • /usr/sbin/cagefsctl –setup-cl-selector
  • The last step is to copy the CloudLinux php binaries over the old hsphere binaries.
    Reason this needs to be done this way is that the hsphere suexec containts the path to the php binaries hardcoded.cp -f /opt/alt/php44/usr/bin/php-cgi /hsphere/shared/php4/bin/php
    cp -f /opt/alt/php52/usr/bin/php-cgi /hsphere/shared/php5/bin/php
    cp -f /opt/alt/php53/usr/bin/php-cgi /hsphere/shared/php53/bin/php
    cp -f /opt/alt/php54/usr/bin/php-cgi /hsphere/shared/php54/bin/php
    cp -f /opt/alt/php55/usr/bin/php-cgi /hsphere/shared/php55/bin/php
    cp -f /opt/alt/php53/usr/bin/php-cgi /hsphere/shared/php-internal/bin/php
    (You need to use PHP 5.3 for internal PHP, otherwise the webshell will no longer work)
    rm -f /usr/bin/php
    rm -f /usr/local/bin/php
    ln -s /opt/alt/php55/usr/bin/php /usr/bin/php
    ln -s /opt/alt/php55/usr/bin/php /usr/local/bin/php

BTW, nothing stops you from for example doing a:
cp -f /opt/alt/php5.6/usr/bin/php-cgi /hsphere/shared/php4/bin/php

So, if nobody uses PHP 4.4 anymore on a server you convert it to PHP 5.6 this way, or if you are on CL6 you can use PHP 4.4 to be PHP 7.

Using the PHP Form Builder Class (PFBC) within your own Joomla Component.

Why?

I was in the need of professional forms for a Joomla component I’m currently writing. With “professional” I mean the forms have to look professional and also need to be validated in a professional manner. I first went through a lot of Javascript/CSS solutions. However, in the back of my mind I thought I still have to validate all input on the Server level (Within the Joomla component itself) Finally I found an actively maintained Forms Library that after some testing worked great within any Joomla Component.

Here are some basic notes on how I accomplished this:

I’m using a file called loader.php located in the library path in my component Directory. I call it from my main controller file like this:

require_once(JPATH_ROOT.DS.'components'.DS.'com_component'.DS.'library'.DS.'loader.php');

in my loader PHP I have this line:

JLoader::register('Form', JPATH_COMPONENT.'/3rdparty/PFBC/Form.php');

As you can see I just copied the PFBC folder into a folder called 3rdparty within my Joomla component folder. Now you can use PFBC anywhere in your component by creating the object like this and add a field for example:

$form = new Form("testing", 300) ;
$form->addElement(new Element_Textbox("My Textbox:", "MyTextbox"));
$form->addElement(new Element_Button);

Assign it to the View as usual:

Joomla Open Source logo

$this->assignRef('myform', $form);

And render it in the tmpl file:

echo $this->myform->render();

PHP 7.2 is now available for your website

PHP 7.2 Hosting

PHP 7.2 has been officially released by the PHP team in November 2017 and is now available for all our customers to use on their website if they wish.

That means HelpingHost.com now offers PHP 7.2 Hosting.

PHP 7.2 contains many improvements and new features such as:

PHP 7.2

  • Convert numeric keys in object/array casts
  • Counting of non-countable objects
  • Object typehint
  • HashContext as Object
  • Argon2 in password hash
  • Improve TLS constants to sane values
  • Mcrypt extension removed
  • New sodium extension

If you want much more detail on what changed, please take a look here.

What does this new PHP version mean to your PHP apps such as WordPress, Joomla, Drupal or Magento?

We found a 10% speed improvement over PHP 7.1 and it is about three times as fast as PHP 5.6. Tests using the latest WordPress did not show any problems.
However, keep in mind that your WordPress plugins also need to be up2date to ensure compatibility with the latest PHP version.

Joomla 3.8 core seems to work as well with this latest PHP release.

Looking for PHP 7.2 Hosting? Give us a try!

Existing customers can change the PHP version used for their website from within the hosting control panel.
Each website can use its own PHP version.

If you feel your site has issues with PHP 7.2 you can also switch back to any older PHP version you like to use.