Hi,
Firstly we’re loving SLIM. We have used it for a REST web service for an EXTJS 6 web & mobile application & it’s going well, working with a mySQL database on a Linode VPS.
We are now moving on to a new (similar) project, again using the latest slim download but in this case we’re using a SQL Server database hosted on AWS. We also have the SLIM REST Web Service running on AWS. All this is actually working fine.
To be able to use Microsoft’s SQL Server ‘bits’ with PHP we had to upgrade our PHP to 7.x. & apache 2.4
On my Mac where I develop & test the web applications, I needed to upgrade to php 7.1.4 to get the Microsoft bits to work.
I want to be able to develop & test run the SLIM web service on m Mac for convenience (as I had done for the first project during development)
Now the issue: I can get a response from the SLIM api but the consistent problem is this syntax error.
Parse error: syntax error, unexpected ‘>’ in /Users//Sites//api/vendor/slim/slim/Slim/Handlers/PhpError.php on line 177
this is on both a POST and a GET (I assume for others as well)
My associate has his environment working fine with the same api code, same PHP version, same apache version but Windows 10
I changed all the double quotes to single quotes and that sorted that error out, but now I have:
Parse error: syntax error, unexpected end of file in /Users/myName/Sites/projectName/api/vendor/slim/slim/Slim/Handlers/PhpError.php on line 206
I tried putting ?> at line 206, made no difference.
Looks like something dodgy happened during download-install.
There are issues with double quotes in other places.
I have finally got phpErrorHandler.php working nicely and it’s reporting issues … all to do with double quotes where single quotes should be.
eg. line 173 in /vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php return str_replace(array("\r\n", "\r", "), ' ', $str); . << one double quote
should be return str_replace(array("\r\n", "\r", ''), ' ', $str); << two single quotes fixes it
There were only 3 issues in total
1 in phpError.php in the renderXmlErrorMessage method
Fix = replace all double quotes with single quotes in that method.
2 in Monolog/Formatter/LineFormatter.php
1 at line 144. $str .= [stacktrace]\n".$e->getTraceAsString(); >> $str .= '[stacktrace]\n'.$e->getTraceAsString();
1 at line 173. return str_replace(array("\r\n", "\r", "), ' ', $str); >> return str_replace(array("\r\n", "\r", ''), ' ', $str);