Page 1 of 1

Broken website (Parse Error)

Posted: Wed Jan 24, 2024 1:57 pm
by garrick5000
I have a WordPress.org site (http://weekenddelsol.com) that I haven’t touched in 7 years, yet have always been able to access. A few days ago, I received an email alerting me that someone—not me—was trying to reset my password, and when I tried to log-in to investigate, I received the following error:

Parse error: syntax error, unexpected ‘[‘, expecting ‘)’ in [host file names]/[user name]/weekenddelsol.com/wp-content/plugins/stagtools/includes/class-stagtools-themes.php on line 19

I guessed that my 4.7 WP site was no longer compatible with Sonic's PHP 4, so I added an .htaccess file with the code lines Sonic suggested to my main directory. That caused the entire site to go down (and throw up some version of the parse error above). I edited the doc to various PHP versions between 5.2 and 5.6, but the site remains broken. Even removing the .htaccess doc did nothing. I also tried renaming the plugin and theme directories to see if that was the issue, but it didn't appear to change anything: still a blank page with a parse error. Any suggestions before I look at migrating to another host?

Re: Broken website (Parse Error)

Posted: Thu Jan 25, 2024 10:00 am
by joemuller
I think I've fixed your site now - here's what I did:
- fixed the file name of .htaccess.txt to .htaccess
- manually installed the latest version of the stagtools plugin (unzipped and copied into the wp-content/plugins/ directory)
- changed the PHP version in the .htaccess file from 'php53' to 'php7'

The main site is loading properly now and I'm able to pull up the admin login page, so hopefully that fixes everything. :)

-- Joe M.
Sonic System Operations

Re: Broken website (Parse Error)

Posted: Thu Jan 25, 2024 11:43 am
by garrick5000
Confirming site is back up, and I can access admin console. Can’t thank you enough, @joemuller. Especially appreciative of you sharing the steps you took. All makes sense save one thing: the Sonic staff I chatted with via phone said PHP 5.6 was the latest version they supported. Can you confirm or clarify?

Re: Broken website (Parse Error)

Posted: Thu Jan 25, 2024 12:01 pm
by joemuller
garrick5000 wrote: Thu Jan 25, 2024 11:43 am Confirming site is back up, and I can access admin console. Can’t thank you enough, @joemuller. Especially appreciative of you sharing the steps you took. All makes sense save one thing: the Sonic staff I chatted with via phone said PHP 5.6 was the latest version they supported. Can you confirm or clarify?
Glad to help!

I just checked and here are the available options: (for Wordpress, I recommend php7 first, then php56 as a fallback)
- PHP 4.4.9 (no htaccess file)
- PHP 5.2.11

Code: Select all

AddHandler php-cgi .php
Action php-cgi /cgi-bin/php5
- PHP 5.3.29

Code: Select all

AddHandler php-cgi .php
Action php-cgi /cgi-bin/php53
- PHP 5.5.37

Code: Select all

AddHandler php-cgi .php
Action php-cgi /cgi-bin/php55
- PHP 5.6.34

Code: Select all

AddHandler php-cgi .php
Action php-cgi /cgi-bin/php56
- PHP 7.4.3

Code: Select all

AddHandler php-cgi .php
Action php-cgi /cgi-bin/php7
If/when you move our Wordpress site to another hosting provider, you'll probably end up on PHP 7 at the minimum, so keep that in mind if any plugins are themes don't work with PHP 7.

-- Joe M
Sonic System Operations