Page 1 of 1

PHP Throwing Syntax errors after uploading to site

Posted: Sun Jul 15, 2018 10:57 am
by calsoft
Ive building a website for a few weeks now. I've been building it using a local Apache server and MySQL database. Everything has been working great locally. I uploaded the files to a subdirectory in my host folder to test the site online but I am now getting an exception: "Parse error: syntax error, unexpected '{' in /nfs/www/WWW_pages/calsoft/ on line 9." I know it's not and issue with my php because it has been working locally. I still attempted to comment out the include of this file to see if it fixed the issue but then I get another syntax error in a different file.
Unsure of where to go from here.

Here is a link to the sites subdirectory that contains my files. ... /index.php

Any help is appreciated

Re: PHP Throwing Syntax errors after uploading to site

Posted: Mon Jul 16, 2018 9:28 am
by drew.phillips

Our default configuration for PHP scripts files uses PHP 4 which in this case appears to be failing due to the use of some PHP 5 functionality.

Per our Php5 Wiki page I've added the .htaccess code to use PHP 5.6 to your "Site" directory and it appears to be working now.

If I can assist further let me know. When you're ready for production, you'll probably want to move that .htaccess file to your site's root so that PHP 5.6 will be in effect for all subdirectories.