I have one problem with my project, when try to upload a new version in my host (HostGator).
This is the error:
PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20131226
PHP compiled with module API=20100525
These options need to match
I change in cPanel the version of PHP 5.4 to 5.6, but when I check the version of PHP in server from connection with putty, I receive the follow message:
PHP 5.4.45 (cli) (built: Apr 17 2017 15:59:08)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.4, Copyright (c) 2002-2018, by ionCube Ltd.
with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies
Maybe this can be the problem? I read about this error, but I cant get a solution. I don’t know if I doing something wrong.
4
Answers
The
php
binary invoked from the command line may or may not be the samephp
binary used by Apache. You should use the following PHP script (save it to a publicly accessible web directory and load it in a web browser) to determine which PHP version Apache is configured to run:cPanel provides 2 different methods of setting the php version. One is called “Select PHP version” which sets the global php version to be used as default for new domains, cron jobs etc, the other is “MultiPHP Manager” which allows you to set different versions of php to be used with different domains under the same cPanel account. You need to make sure “MultiPHP Manager” also lists the correct php version for your domain (It can override “Select PHP version” setting).
Simply modifying HTACCESS file:
First of all, Hostgator will deprecate versions older than 7.2 by October 2020.
Second, if the following solution doesn’t solve your problem, be sure there’s no .htaccess file in a parent folder with different instructions (MySQL module seems to be indicated by the first version indicated in the folder hierarchy, and PHP by the last one).
Use the following code in htaccess file (lines with # at beginning are commented):
Thanks to @anayarojo for the tip for v7.2 (in April 2020).
Just add this lines to your .htaccess for newer versions of php to work:
For PHP 7.2:
For PHP 7.3: