Hi my problem is that I am getting this error here on ym PHPBB3 website
Parse error: syntax error, unexpected '}' in /public_html/cache/tpl_anami_overall_header.html.php on line 309
It happened when I installed a mod onto PHPBB3 and it suddenly became like this.
Notes: (Things that didn't work for me)
I have tried deleting the files off the cache
I have tried restoring backups of previous dates
Also would my forum data such as posts, forums and topics be deleted if I would reinstall a new version of PHPBB3 into my directory with the same sql database? If this is possible, I would just reinstall phpbb instead
Thanks
Actually this is very simple error you are talking about. This should be solved by yourself. Use PHP Syntax Checker or other tools for this.
The cache file is generated from styles/anami/templates/overall_header.html.
Open the cache file and look at line 309, find the matching line in the file above and fix the syntax error on that line, then clear the cache.
in a text editor open styles/anami/templates/overall_header.html and check every <-- IF xxx --> and <!-- BEGIN xxx --> statement opens and closes correctly. You may find you have one too many <!-- ENDIF --> or <!-- END xxx -->
Related
After an automatic update to my WordPress installation, my website is display this error rather than loading.
Deprecated: File wp-db.php is deprecated since version 6.1.0! Use wp-includes/class-wpdb.php instead. in /home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/functions.php on line 5595
Warning: require(/home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/class-wp-dependencies.php): failed to open stream: No such file or directory in /home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/script-loader.php on line 23
Fatal error: require(): Failed opening required '/home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/class-wp-dependencies.php' (include_path='.:/usr/share/pear/') in /home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/script-loader.php on line 23
Notice: Function is_embed was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in /home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/functions.php on line 5835
Notice: Function is_search was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in /home/vol13_4/epizy.com/epiz_30367402/htdocs/wp-includes/functions.php on line 5835
There has been a critical error on this website.
Can someone help me understand this error, and provide me a solution or some hints so that I can figure a fix for this.
I also had the same problem currently. So here's how I fixed it.
Go to your Website's App Installer > Wordpress > and find something like this
https://i.stack.imgur.com/xvhm0.png
Click the one in the blue box i drew at the right (Wordpress Manager)
Then, there you can update wordpress
Hope it helped!
i solved it just by updating all plugins, idk why it worked but you can give it a try.
I am diagnosing an issue with WP_cron(), so I wrote a very short app to list cron() tasks that are pending.
<? php
/*
Plugin Name: My WP-Cron Test
(there are more comments here but I left them out for brevity)
*/
function wpcron_print_tasks() {
echo '<pre>';
print_r( _get_cron_array() );
echo '</pre>';
}
?>
Attempting to activate this tiny plugin leads to the following:
Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected 'function' (T_FUNCTION) in
/latamconnex/wp-content/plugins/my-wp-cron-test/my-wp-cron-test.php on
line 12
Line 12 triggers this according to the compiler, i.e. wpcron_print_tasks().
Somehow, even if this plugin only had a line with an echo command, it triggers the error.
Is there something basic I am missing about building a simple plugin?
Basically, I'd like to know what I need to know in order for even the simplest of plugins to activate.
System details: WordPress 4.7, PHP v. 7.0.13, deployed online with Pressable.com
Q1: Why is the error happening?
Let's look at what the error says. The message you get tells you what the problem is and where it's throwing the error. Let's break it down.
Plugin could not be activated because it triggered a fatal error. Parse error: syntax error, unexpected 'function' (T_FUNCTION) in /latamconnex/wp-content/plugins/my-wp-cron-test/my-wp-cron-test.php on line 12
It's a "syntax error"
It's located in the file /latamconnex/wp-content/plugins/my-wp-cron-test/my-wp-cron-test.php
The error is thrown on line 12 of that file.
It's telling you there is a syntax error on or before line 12 of that file.
Looking at your code, line 1 has an error in it. Do you see it? You have <? php on line 1. PHP is not going to recognize that line as the opening PHP tag. Why? There's a space in between the ? and php.
Change that line to <?php. Notice, there's no space.
Make sure there are no other syntax errors between line 1 and 12.
Tip: Remove the Closing PHP Tag
You don't need the closing PHP tag ?> at the end of the file. I recommend removing the closing PHP tag.
Why? Any extra spaces or lines after that tag will cause the dreaded white screen of death. You can see the conversation about it here on Stack Overflow.
The best practice here is to omit the optional closing tag from all PHP files.
Q2:
Basically, I'd like to know what I need to know in order for even the simplest of plugins to activate.
First, WordPress has to recognize your code as a "plugin." Then once it finds it, then it's available for activation. There does not have to be a single line of code in the file for it to be activated.
How does WordPress recognize the plugin?
WordPress searches each folder in the wp-content/plugins folder. It's looking in the root of each folder for a bootstrap file.
What makes a file the "bootstrap?"
It's the file header (DocBlock) that identifies the plugin and makes it available to WordPress. That's your bootstrap file.
WordPress searches in the plugin folder's root for the file that has the properly structured file header.
The structure is defined in this Header Requirements document.
What should be in a plugin file?
All that's needed for the file to be activated is:
The opening PHP tag, i.e. <?php
The file's DocBlock
That's it. Now it's added to the list of plugins in Plugins > Installed Plugins (in the WordPress back-end admin).
I have various PHP files, none of which have been modified prior to the app working and it breaking. My problem is that for some reason, these files are suddenly throwing PHP parse errors for things like 'unexpected' square brackets in seemingly random places throughout the file, but upon manually checking the file, the syntax is correct.
The only thing I did that could have 'altered' the files would be various chmod operations to change the permissions. But how/why would this change the actual content of the files?
The files are called on boot just as they always have been, and have worked fine in the past, up until the recent chmod changes.
Is this permanent, or will I just have to restore my system from an earlier time?
RHEL 6.5, PHP 5.4.
Edit:
Example of the error:
PHP Parse error: syntax error, unexpected '[' in /var/ptc/CRM-dev/tools/init on line 122
What's on line 122:
$files = [];
Another example:
PHP Parse error: syntax error, unexpected '[', expecting ')' in /var/ptc/CRM-dev/vendor/react/promise/src/functions.php on line 68
What's on line 68:
return resolve([]);
But these files themselves haven't been changed (as far as I'm aware), and the syntax looks correct.
phpinfo() gives 5.4.39, which is the same as when running php -v on the server.
If the PHP version has been changed then it may be stumbling on the PHP 5.4 square bracket array syntax.
Use phpinfo(); to be sure that the PHP version running the web server is the same as the one you're using on the CLI.
I had a website but is currently gone but I always had a back-up that worked on my hosting always.. I tried setting my website up on XAMPP but I keep getting the error: Parse error: syntax error, unexpected end of file.. I tried closing brackets but it didn't work. Can you guys please help me where the problem is? This is the index.php of my template where I'm getting it(backend of Joomla is doing fine):
http://pastebin.com/CzGbybYZ
Thanks.
My guess? Short tags aren't enabled, meaning the <? } ?> is not recognised as your "end of code block". Use <?php } ?> instead.
I am working with Joomla 2.5.7, when trying to add or modify an article I get this error:
Uncaught SyntaxError: Unexpected end of input
But this only happens with Chrome, if I try to create an article using FireFox then it goes ok.
Does any one of you have had this error before?
Seems Chrome doesn't load properly the tiny_mce.js:1 file and get:
Uncaught SyntaxError: Unexpected end of input
before get
Uncaught SyntaxError: Unexpected end of input
, I have uploaded again the file but still get the error and still works only on FF.
When none of the editors works in the joomla administrator, you only see a textarea and there is an undefined error in the javascript console, it is posible that you don't have the live_site parameter set in the configuration.php. It should be an absolute url to the joomla index, for example:
public $live_site = 'http://www.example.com/example';
The simpliest way to solve this and other issues with the common Joomla editors is to move to JCE (Joomla Content Editor) which can be download from: http://www.joomlacontenteditor.net/
I have encountered the same problem as you.
In chrome, clear all your browsing data, and restart chrome.
The problem will be solved.