sagnik Posted December 12, 2019 Share Posted December 12, 2019 Why the following error has occurred in PHP 7.1? As far as I know, the 'Object' is used as a reserved keyword from PHP 7.2. I'm using PHP 7.1.1 in my local server and it works fine without any errors then why not in Heliohost? And I've switched from PHP 7.3 to PHP 7.1 using MultiPHP Manager in cPanel.Fatal error: Cannot use 'Object' as class name as it is reserved in /home/sgn/public_html/careers4you/config/classes/Careers4You/Helpers/Object.php on line 31 Quote Link to comment Share on other sites More sharing options...
wolstech Posted December 12, 2019 Share Posted December 12, 2019 (edited) It sounds like your domain is not actually changing php versions. I'll take a look when I'm at a computer.Nonetheless, it's still a bad idea to use object in this manner anyway, since in the future you may need to run this on newer php. The best fix is to not use the word object this way. Edited December 12, 2019 by wolstech stupid autocorrect 1 Quote Link to comment Share on other sites More sharing options...
sagnik Posted December 12, 2019 Author Share Posted December 12, 2019 Okay, I'll change the name but to change the name I've to change lot of things. For now I just need to check if everything is working fine. Quote Link to comment Share on other sites More sharing options...
wolstech Posted December 12, 2019 Share Posted December 12, 2019 I'm assuming the file that's erroring is being included by something located in /home/sgn/public_html/careers4you/public_html ? If so, try adding this to the .htaccess in that folder: <IfModule mime_module> AddHandler application/x-httpd-ea-php71 .php .php7 .phtml </IfModule> Also, keep in mind that the PHP version used is based on the configuration for the script the user visits in their browser (i.e. you can't use a different version just for the includes). Includes can't have their own separate version of PHP, but rather an included file always inherits the PHP version of its includer. 1 Quote Link to comment Share on other sites More sharing options...
sagnik Posted December 12, 2019 Author Share Posted December 12, 2019 Okay thanks! Let me try this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.