Where am I supposed to see FirePHP output? - php

I am trying out FirePHP.
I installed it and restarted Firefox, enabled Firebug for my localhost, moved the demo oo.php file that comes with the download into an IIS virtual directory, changed the include path, removed the apache_request_headers() call since I am running IIS, and the only output I see is
Notice: Undefined offset: 1 in
C:\Documents and Settings\georgem\My
Documents\projects\auctronic\FirePHPCore\FirePHP.class.php
on line 167
Hello World
Nothing appears in the Firebug console.
Am I missing something?
EDIT: Noticed it said that output buffering has to be enabled so I added a call to ob_start() at the top of the file...same results.

I believe FirePHP required you install a Firefox extension (in addition to Firebug) that watches for the HTTP headers and puts them in the console.
If that isn't the problem then I'd recommend grabbing a copy of Charles. It will let you view the headers of the HTTP response. The FirePHP output should be visible there. If it's not then the problem is in your server set up.

Make sure you have the latest version of both extensions, Firebug and FirePHP - there has been some mishap lately with the most recent Firebug and older FirePHP (and yes, FirePHP requires both including the PHP on the server and installing the extension on the 'fox).
Include fb.php, do ob_start(), make up a variable of your own and then
fb($myErrorVariable, 'My brand new error', FirePHP::ERROR);
You should see the the output both in the Firebug console and under the Net tab (expand the first line relative to your script and tab to 'Server').

I had the same issue and it turned out that the 'Net' tab of firebug wasn't enabled caused firephp to not show anything in the console. Enabled Net tab and voila!

Related

Xdebug 3 / PHP / VS Code / Win10 - Not opening in browser properly - any ideas what's wrong?

I've installed XAMPP (control panel 3.3.0) on my Windows 10 PC. I then installed VS Code (v1.74.3)
I ran the phpinfo() and pasted the results into the Xdebug wizard and followed the instructions on that page (downloaded php_xdebug-3.2.0-8.2-vs16-x86_64.dll, renamed as php_xdebug.dll and saved to C:\xampp\php\ext)
I then added the following to C:\xampp\php\php.ini file.
zend_extension = xdebug
I restarted the Apache server and VS Code. I also installed the PHP Debug (v1.30) extension to VS Code.
When I load up a test PHP file and try to debug it, it seems to work as expected in VS Code (it stops at breakpoints, I can step through, the variables pane updates, and echo'd text appears in the debug console. This is when I do "launch currently open script").
But when I do "launch built-in web server", to see what it looks like in a browser, it opens Chrome to http://localhost:62xxx/ (the number changes each time) and the page says:
Not Found
The requested resource / was not found on this server.
I've probably just missed a setup/config step somewhere. How do I get it to open a browser that shows what the script is outputting?

TYPO3 and IOS: can't open the page

My situation:
I have 10 typo3-websites running on two servers:
First Server (apache with php 5.6.32):
typo3 versions: 6.2.3, 6.2.4 and 6.2.14
Second Server (apache with php 7.0.26):
typo3 versions: 7.6.14 and 8.7.1.
I'm not able to open the page on an iPhone or iPad with osx 10.x or above. I tested it on safari, chrome and firefox, but I get always an error like:
"[browser] can't open the page (...) because the server unexpectedly dropped the connection. (...)"
On a mac (osx 10), I get the error only in safari 11.0.2, but not in firefox or chrome.
I can open the pages without any problems, if I'm logged in at the typo3-backend with the same browser.
A Wordpress-Page is also running on the second server without any problems.
I have no problems on windows, android or other linux machines.
I tried the following without success:
clearing the typo3 cache
using the default .htaccess
using an empty .htaccess
The solutions from this site (german!): http://www.typo3forum.net/discussion/79617/ios-10-3-1-laedt-seite-nicht
Any ideas?
Have you tried to set the header content-length to 0?
https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#enablecontentlengthheader
Try to set the following lines to your TypoScript
config.enableContentLengthHeader = 0
You say you can open the page if you are logged in that matches the following description:
If the Backend user is logged in, this is disabled. The reason is that
the content length header cannot include the length of these objects
and the content-length will cut off the length of the document in some
browsers.

PHP Error message in Firefox not Chrome

One of our websites earlier today started outputting a few PHP warnings that were only visible through Firefox but weirdly the errors wouldn't show in Chrome or Safari.
I had a look at the request/response headers and noticed in the response header for Firefox the entry
X-pad: avoid browser bug
Could this be the reason for the discrepancy in between the two browsers? From what I could find, X-pad was a work around for a bug that existed in an ancient browser.
Below is a screenshot of the errors from Firefox.
Error Message
Edit.
Found out the cause of the error and also why chrome wasn't showing the warnings. A number of pages on our site had been injected with some code, as documented here. The code was ignoring safari and chrome , but not Firefox. Hence the discrepancy.
As for the fix, simply remove any instances of the code. Affected, were instances of index.php/template.php/page.php files.
Uninitialized string you get because your variable is not setted in an array. Make sure that is setted.
if (isset($somevar['var']))
{
// etc..
}
Your session_start() code is NOT on your TOP in a PHP file. A session_start() should be called before all scripts executed.
To turn off showing errors manually via PHP put on top:
ini_set("display_errors", 0);
Put all your errors to error.log file instead of showing errors on PHP production environment.
X-Pad is header appender to the response from apache. So this isn't way what errors occured. X-Pad doesn't relation with your errors.

Blank pages after installing PHP on IIS

I am attempting to install PHP onto Windows Server 2008 R2. I have followed the instructions here but when I try to load phpinfo.php I get a blank page.
There are no errors in the Event Viewer.
The server is used to host multiple other Asp.Net websites but I am using PHP so that I can install MediaWiki.
UPDATE:
When trying to load simple HTML (with no PHP) it also loads as blank. The fix for this seems to be to enable "Static Content" in the "Turn Windows features On/Off" manager - but this is already in place.
This happened to me as well just running the handy dandy php installer microsoft has on their site using their Web Platform Installer and it turned out in the php.ini file by default short_open_tag by default is off so my code
<?
print("hello world!");
?>
would not work because it was expecting
<?php
print("hello world!");
?>
.... so yea ... just go and change that if this is your problem too!
If copying over an old Wordpress installation from an old server - make sure you copy ALL the files. Oops... <embarassed>
A blank page is also possible when there is an PHP error and error reporting is of. Try to run the script below to see what happens.
<html>
<body>
Hello HTML
<?php
error_reporting(E_ALL);
echo "Hello PHP";
?>
</body>
</html>
You could also try to see if a normal HTML page with PHP extentions runs fine. Perhaps your server is setup to disallow PHP extention.
You have to configure fastCGI for each PHP website, more details you can find here - Best Practices for Configuring FastCGI and PHP
So I found the solution after hours of randomly trying things. I removed and re-added the Static Content role in Windows - still same result. Then I edited the Error Pages feature of the website in IIS to say return Detailed Error Messages. At this point PHP started to complain about the timezone so I set to "Europe\London" - for this to take effect you need to restart IIS.
After that it worked, phpinfo now loads!
I had this issue; at "turn Windows features on or off", I enabled:
HTTP Errors
Server-Side Includes
Directory Browsing
Windows Authentication
I also set these options in C:\Program Files (x86)\PHP\v5.3\php.ini:
display_errors = On
display_startup_errors = On
After that, a 401 Unauthorized error was displayed. I added 'Everyone' and 'Users' groups to the folder to fix.

Why am I not seeing any firephp output?

I am trying to get firephp to work. It was working as of last week and I don't know when
exactly it stopped working or what I changed.
I am now trying to do a simple firephp hello world.
<?php
require_once('FirePHPCore/FirePHP.class.php');
ob_start();
$firephp = FirePHP::getInstance(true);
$firephp->log('Hello', 'World');
require_once('FirePHPCore/fb.php');
$var='test';
fb($var);
FB::send($var);
ob_end_flush();
?>
There is no result in the firebug console window and no error messages I can find.
FireFox 5.0
FireBug 1.8.0
PHP 5.3.1
Firebug console and net panels are enabled. FirePHP is enabled.
In the net panel under the get request, I do not see any X-wf- headers.
Firebug has to have the Net panel enabled.
EDIT: Just press f12, click on the Net and if it says enable, click on enable :)
This one is ridiculous but I just wasted 30 mins, make sure you have your output set on 'All' and not 'Errors' or something like that in the firePHP console.
The FirePHP Extension now works again with Firebug 1.8: http://www.firephp.org/HQ/FinalRelease.htm
Explanation of what happened: http://www.christophdorn.com/Blog/2011/08/03/firephp-and-firebug-1-8/
It seems there is a knowned issue using the latest Firebug version 1.8 and Firefox 5:
http://groups.google.com/group/firephp-dev/browse_thread/thread/aa8ca7877f4f2d82?pli=1
Downgrading to version 1.7.3 solved the problem for me.
http://getfirebug.com/releases/firebug/1.7/firebug-1.7.3.xpi
You need to call ob_end_flush() for any output to get sent to the browser.
As I was led here by a google result motivated by the same problem I would like to add some perspective for posterity.
While testing in local environment on any of the new Windows OSs (Windwos 7 and above) you should check if your file is blocked .
That's right: in my case require_once didnt throw any fatal errors which it should if it couldnt find the file - so sth. had to be wrong with the file.
On Linux you would check permissions, on windows you need to check the file properties and see if the file is being blocked.
If it is and you have admin privileges, you can unblock it then and there.

Categories