Wednesday, 15 February 2012

php - Code working locally but not on host -


I am working on a website. I am using an external class to do some image processing. It works perfectly on a mamp server, but I get an error on the host

  Parse error: syntax error, unexpected ':' in / home / A3526504 / public_html /post/src/abeautifulsite/SimpleImage.php line 251  

line:

$ height = $ height?: Width $;

The server is running php: 5.2

Solution: I used the first switch I hosted 000webhost, obviously that is dead, and they are hostinger To swap it out They run PHP 5.6.

$ height = $ height: $ width;

This will only work in PHP 5.3 and above.


No comments:

Post a Comment