Hi Recently I have updated my PHP version from 5.0 to 5.4,but it creates error in my CakePHP projects because it was running on older version of PHP the error are
Fatal Error: syntax error, unexpected end of file
It is common error error displaying on every projects how to remove this please help.thanks
Open you short_open tag in your php.ini file
short_open_tag=Off
To
short_open_tag=On
Related
i'm using endroid Qrcode bundle for creation of Qrcode object. I have an critical error because the QRCode object (https://github.com/endroid/QrCode/blob/master/src/QrCode.php) in this bundle use this constant. If i modify the source of the QRCode all works fine, but obviusly that is not a good solution. Why i have this bug on symfony? How can I fix it?
This my error
Parse Error: syntax error, unexpected '.', expecting ',' or ';'
500 Internal Server Error - FatalErrorException
And this is the bundle: https://github.com/endroid/QrCode
The reason would be the PHP version of your current server: if you do have a version of PHP below 5.6, concatenation in a constant is not allowed by PHP. It is allowed only as of PHP 5.6.0
Note:
Constant expression support was added in PHP 5.6.0.
source: http://php.net/manual/en/language.oop5.constants.php#example-185
Related answer from SO that got me there: https://stackoverflow.com/a/36693544/2123530
I have various PHP files, none of which have been modified prior to the app working and it breaking. My problem is that for some reason, these files are suddenly throwing PHP parse errors for things like 'unexpected' square brackets in seemingly random places throughout the file, but upon manually checking the file, the syntax is correct.
The only thing I did that could have 'altered' the files would be various chmod operations to change the permissions. But how/why would this change the actual content of the files?
The files are called on boot just as they always have been, and have worked fine in the past, up until the recent chmod changes.
Is this permanent, or will I just have to restore my system from an earlier time?
RHEL 6.5, PHP 5.4.
Edit:
Example of the error:
PHP Parse error: syntax error, unexpected '[' in /var/ptc/CRM-dev/tools/init on line 122
What's on line 122:
$files = [];
Another example:
PHP Parse error: syntax error, unexpected '[', expecting ')' in /var/ptc/CRM-dev/vendor/react/promise/src/functions.php on line 68
What's on line 68:
return resolve([]);
But these files themselves haven't been changed (as far as I'm aware), and the syntax looks correct.
phpinfo() gives 5.4.39, which is the same as when running php -v on the server.
If the PHP version has been changed then it may be stumbling on the PHP 5.4 square bracket array syntax.
Use phpinfo(); to be sure that the PHP version running the web server is the same as the one you're using on the CLI.
Getting website encountered an unexpected error, please try again while adding goals using goals module in demo framework drupal 7.
and in recent logs I get the
Recoverable fatal error: Object of class Entity could not be converted to string in DatabaseStatementBase->execute() error
I found a work around.......
I disabled the personalize module and the error is gone. So the problem was some conflict between Personalize and goals module....... I 'm working on how to get these two modules working together
Problem was----->
Recoverable fatal error: Object of class stdClass could not be converted to string
Answer: I have uninstalled XAMPP 3.2.3 control panel which was using php version 7.x
and then install XAMPP 3.2.1 control panel which uses php version 5.6.3. After using XAMPP 3.2.1 the problem is solved.
To see php version use the command as following
c:\cd xampp\php
c:\xampp\php>php -v
I have developed new website in Joomla 3 and now want to transfer it to new hosting and domain.
I have copied all files and directories and created databases. Also changed configuration file.
The problem is that new hosting company runs PHP 5.2.17 version and I removed this string in index.php where it is checking for php version.
After that I have strange error
Warning: require_once(__DIR__/includes/defines.php) [function.require-once]: failed to open stream: No such file or directory in /usr/.../public_html/index.php on line 28
Fatal error: require_once() [function.require]: Failed opening required '__DIR__/includes/defines.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /usr/.../public_html/index.php on line 28
How can I fix it? Thanks in advance. I can not use php.ini and changing hosting company is big problem.
Minimum requirement of PHP version is PHP 5.3 for Joomla 3. So you should upgrade your PHP version otherwise use Joomla 2.5
You may get other issues also, if you use Joomla 3 on PHP 5.2. To fix this issue you need to replace __DIR__ with dirname(__FILE__)
The version check isn't just for show. Requirements for Joomla 3.* is PHP 5.3.1 or higher.
Even if you fix what bugs you find now, you will definitely encounter problems later if you do not upgrade the PHP version.
Just to get an idea of how ugly things can get - check the PHP changelog. There are a lot of changes in 5.3.0 and 5.3.1, and any of them can cause unexpected behavior.
Warning: preg_match() [function.preg-match]: Compilation failed: repeated subpattern is too long at offset 18454 in /Smarty_Compiler.class.php on line 454
Fatal error: Smarty error: [in login.tpl line 1]: syntax error: unrecognized tag: php (Smarty_Compiler.class.php, line 455)
this message coming.. it was working perfect on dev server but on live server its not working.
Dev php version was 5.2.14
new server has PHP Version 5.2.6
is this the problem?
What smarty version are you using?
This thread seems to imply it has to do with a combination of Smarty versions and php version:
http://www.smarty.net/forums/viewtopic.php?t=14563
For most users the sollution seems to be to downgrade Smarty from 2.6.21 to 2.6.20
It's kind of an old thread though, so check if it applies, but it seems akin to your problem.
Which version you are using ?
Use the latest version of smarty it might solve your problem.