/    Sign up×
Community /Pin to ProfileBookmark

Parse error: syntax error, unexpected ‘exit’ (T_EXIT)

Hi,

I’m new to this forum so not so sure if I’m posting in the right place or about the full rules and regulations of the forum system, so if I’ve got something wrong please redirect me and let me know.
Basically, I’m receiving a parse error when trying to go onto our website – I had tried restoring my website from an old backup and now it’s giving me this error:

Parse error: syntax error, unexpected ‘exit’ (T_EXIT) in /home/cdchk/domains/dev.cdchk.org/public_html/wp-content/plugins/woocommerce-catalog/include/php/settings.php on line 1

I tried looking into this file (settings.php under the WooCommerce Catalog Plugin files), but am lost as to what the error is. I will post the first section of the code below. Let me know if there’s an issue. Thanks.

[code=php]<?php

if (!defined(‘ABSPATH’)) exit;
class Woo_Catalog_Settings

{
private $dir;
private $file;
private $assets_dir;
private $assets_url;
private $settings_base;
private $settings;
public

function __construct($file)
{
$this->file = $file;
$this->dir = dirname($this->file);
$this->assets_dir = trailingsla****($this->dir) . ‘include’;
$this->assets_url = esc_url(trailingsla****(plugins_url(‘/include/’, $this->file)));
$this->settings_base = ‘woo_Catalog_’;

// Initialise settings

add_action(‘admin_init’, array(
$this,
‘init’
));
[/code]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@ginerjmJan 07.2016 — Exit usually has a set of (). Code it thusly and see what happens.
Copy linkTweet thisAlerts:
@NogDogJan 07.2016 — exit is a language construct and it can be called without parentheses if no status is passed.[/quote]

In any case, I'm confused -- assuming that is the correct file -- since "exit" is on line 3, but the error says line 1. ? Are you sure you're looking at "/home/cdchk/domains/dev.cdchk.org/public_html/wp-content/plugins/woocommerce-catalog/include/php/settings.php"?
Copy linkTweet thisAlerts:
@NogDogJan 07.2016 — PS: If it is that file, I might try rewriting it this way, if nothing else perhaps at least getting the error message to change the line number?
[code=php]
<?php

if (!defined('ABSPATH')) {
exit;
}
class Woo_Catalog_Settings
[/code]
×

Success!

Help @chiranjiv spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...