2

I am writing a web page that uses some php files. The php isn't working properly and I am trying to debug for things such as printing variables. I am new to php so this is all new territory.

I use firebug for other debugging and css alignment so I thought firephp might be a good way to begin.

I added firePHP into firefox and then following some tutorials I found I added this to my php file:

<?PHP
/* comment here down to line 15 */
require_once('FirePHPCore/FirePHP.class.PHP');
$firephp = FirePHP::getInstance(true);

The result I get when I load my page is:

Warning: require_once(FirePHPCore/FirePHP.class.PHP): failed to open stream: No such file or directory in /var/www/contactform.php on line 15 Fatal error: require_once(): Failed opening required 'FirePHPCore/FirePHP.class.PHP' (include_path='.:/usr/share/php') in /var/www/contactform.php on line 15

It seems like some more setup and library loading is required, but I am not sure what or how?

I am developing on Ubuntu using apache and /var/www/ as my local server.

Description:        Ubuntu 11.04
Release:    11.04
Codename:   natty

Advice on how to get past this error?

codingJoe
  • 4,713
  • 9
  • 47
  • 61

2 Answers2

1

require_once('FirePHPCore/FirePHP.class.php');

The file extension (.php) is NOT SUPPOSED TO BE CAPITALIZED.

Mark Moran
  • 13
  • 3
1

You need to add the "FirePHPCore" folder to the same directory that this code is being run in

nathanjosiah
  • 4,441
  • 4
  • 35
  • 47
  • That doesn't seem to work. I downloaded FirePHPCore and put it in `/var/www/`, `/var/www/include/`, and `/usr/share/php`. I get the same same results. `/usr/share/php/` is listed as an include directory. Any other advice? – codingJoe Apr 02 '12 at 03:28
  • I also tried: `sudo apt-get install php-pear`; `sudo pear channel-discover pear.firephp.org`; `sudo pear install firephp/FirePHPCore`; also to no avail. Same error message... what gives?? – codingJoe Apr 02 '12 at 03:45
  • That error is thrown when the file trying be loaded via "require" doesn't exist. Here are the instructions for installing the server code: http://www.firephp.org/HQ/Install.htm – nathanjosiah Apr 02 '12 at 03:57
  • you have to point your `require_once('FirePHPCore/FirePHP.class.PHP');` to the directory that FirePHP is installed in. http://www.firephp.org/HQ/Learn.htm – nathanjosiah Apr 02 '12 at 03:59
  • Thanks! That was the clue I needed. (Modified the question show the include path.) pear installed FirePHPCore in `/usr/share/php` I also restarted apache2 which I hadn't previously and my error went away. – codingJoe Apr 02 '12 at 04:42
  • I assumed incorrectly that my app root = www. doh! so this failed "require_once ('/FirePHPCore/FirePHP.class.php');" I had to reference like this "require_once ('../FirePHPCore/FirePHP.class.php');" (Note the ../). Hope that helps someone. It helped me. – Mike S. Apr 17 '12 at 13:58