Wordpress-ob_start():failed to create buffer - wordpress

My website was built with wordpress and now I get the following error:
PHP message: PHP Warning: ob_start(): function '‘ob_gzhandler’' not
found or invalid function name in /var/www/html/wordpress/index.php on
line 15
And this is index.php:
enter image description here
Any idea to fix it?

Try setting the Content-Encoding header.
header('Content-Encoding: gzip');

Related

Using i18n in SilverStripe template

I'm using SilverStripe 3.7.1 and PHP 7.2. To translate string in my template I use syntax
<%t Namespace.Entity "String_to_translate" %>
When length of the "String_to_translate" is more than 2045 symbols I get error:
[26-Jul-2018 10:18:33] Error at framework/view/SSTemplateParser.php line 4028: Uncaught SSTemplateParseException: Parse error in template on line 163. Error was: Malformed opening block tag t. Perhaps you have tried to use operators?
Can I change the maximum length of the string to translate?

Closure Compiler: JSC_PARSE_ERROR: Parse error

Does anyone know how to fix the following error when trying to use Google's Closure Compiler:
JSC_PARSE_ERROR: Parse error. primary expression expected at line 1 character 1 in www.myWebsite.co.uk
<!DOCTYPE HTML>
^
If i just specify javascript files i get the following error (errors appear for each file when i do one at a time):
JSC_PARSE_ERROR: Parse error. primary expression expected at line 17 character 72
http://www.myWebsite.co.uk/javascripts/tinynav.min.js
That files code is as follows:
/*! http://tinynav.viljamis.com v1.1 by #viljamis */
(function(a,i,g){a.fn.tinyNav=function(j){var b=a.extend({active:"selected",header:"",label:""},j);return this.each(function(){g++;var h=a(this),d="tinynav"+g,f=".l_"+d,e=a("<select/>").attr("id",d).addClass("tinynav "+d);if(h.is("ul,ol")){""!==b.header&&e.append(a("<option/>").text(b.header));var c="";h.addClass("l_"+d).find("a").each(function(){c+='<option value="'+a(this).attr("href")+'">';var b;for(b=0;b<a(this).parents("ul, ol").length-1;b++)c+="- ";c+=a(this).text()+"</option>"});e.append(c);
b.header||e.find(":eq("+a(f+" li").index(a(f+" li."+b.active))+")").attr("selected",!0);e.change(function(){i.location.href=a(this).val()});a(f).after(e);b.label&&e.before(a("<label/>").attr("for",d).addClass("tinynav_label "+d+"_label").append(b.label))}})}})(jQuery,this,0);
I don't understand where the error is?
The closure compiler compiles closure-annontated JavaScript ; not random JavaScript.
As in the comments, CC is seeing a webpage. That webpage is the Git page, not the actual extern URL required in the CC header.
To Fix:
When at Github looking for your extern file:
https://github.com/google/closure-compiler/blob/master/contrib/externs/jquery-1.12_and_2.2.js
Click the button called Raw to see the actual file URL: https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/jquery-1.12_and_2.2.js
Then copy it in to your CC header
// #externs_url https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/jquery-1.12_and_2.2.js

Fatal error: UnCSS: could not open

I'm trying to remove all of the unused css in the framework I'm using by using uncss. But when I try I get the error:
file:///C:/Users/Angus/Desktop/FTTL%20website%20submit/index.html:15 in onload
Fatal error: UnCSS: could not open C:\Users\Angus\Desktop\FTTL website%20submit\css\main.css
Does anyone know why this is?
Iyou forget to handle the first space properly (FTTL website%20submit) in the path, if you change the folder name or escape it properly (like FTTL%20website%20submit) it might work.
Edit: Or the other way around and the %20 substitution for the path was not working for the second space. (I am not familiar with uncss.)
(In my opinion it is best not using spaces in file and folder names.)

getting fatel error when trying to apply featured-posts-slideshow wp-plugin

Error occured while trying to apply this plugin in my template page
like this:-
Fatal error: Call to undefined function get_bloginfo() in
/wp-content/plugins/featured-posts-slideshow/featured-posts.php on
line 2
Please help its urgent.Thanks in advance
Try using this code instead of your include function:
include (ABSPATH . '/wp-content/plugins/featured-posts-slideshow/featured-posts.php');

Error - Warning: Cannot modify header information - headers already sent by

Error:
Warning: Cannot modify header information - headers already sent by
(output started at /home/ya3mblog/public_html/wp-login.php:59) in
/home/ya3mblog/public_html/wp-includes/pluggable.php on line 866
website: ipublisharticles.com Error is at:
ipublisharticles.com/wp-login.php?action=register
It's preventing user registration using the proper method.
Add this code in wp-config.php on the first line:
ob_start();
error_reporting(0);
See How_do_I_solve_the_Headers_already_sent_warning_problem? > FAQ Troubleshooting « WordPress Codex
(This error) is usually because there are spaces, new lines, or other
stuff before an opening <?php tag or after a closing ?> tag,
typically in wp-config.php.
Open the file with a plain text editor (like Notepad or BBEdit) and clear out the white space. Check that the very first characters are <?php
and the very last characters are either NOT a PHP closing tag, or a closing tag ?> with no blank lines or spaces after it. (FYI, a PHP file can run fine without the closing ?> tag.)
When saving, be sure the file encoding is not UTF-8 BOM but plain UTF-8 or any without the BOM suffix.
And:
This could be true about some other file too, so please check the
error message, as it will list the specific file name where the error
occurred. Replacing the faulty file with one from your most recent
backup or one from a fresh WordPress download is your best bet.
If the error message states: Warning: Cannot modify header information
- headers already sent by (output started at /path/blog/wp-config.php:34) in /path/blog/wp-login.php on line 42,
then the problem is at line #34 of wp-config.php, not line #42 of
wp-login.php. In this scenario, line #42 of wp-login.php is the
victim. It is being affected by the excess whitespace at line #34 of
wp-config.php.
If the error message states: Warning: Cannot modify header information
- headers already sent by (output started at /path/wp-admin/admin-header.php:8) in /path/wp-admin/post.php on line
569, then the problem is at line #8 of admin-header.php, not line #569
of post.php. In this scenario, line #569 of post.php is the victim. It
is being affected by the excess whitespace at line #8 of
admin-header.php.
remove the excess blankspace /home/ya3mblog/public_html/wp-login.php in line 59.
In my case happened because from the Wordpress Rest API in the functions I was ending the job by doing
echo json_encode($result);
instead of the simple:
return $result;
Changing that.. worked!

Resources