Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path

23 March 2008 – 5:52 pm by wg

I have just installed Cacti on a new FreeBSD 6.3 machine that I’ve been playing with, and the latest version from ports seems to be broken, displaying the error “Invalid PHP_SELF Path” when I browse to it with a web browser.

A Google search reveals that it seems to be a common problem. This post on the Cacti forums proposes a temporary fix, which I have implemented and seems to work without any problems. It may expose your cacti installation to security problems, but I haven’t looked in to this, and I suspect that most Cacti installations (like mine) are protected by htaccess authentication anyway.

The fix:

In the file /usr/local/share/cacti/includes/global.php, comment out (by prepending //), or delete line 113:

if (!((is_file($_SERVER["SCRIPT_FILENAME"])) && (substr_count($_SERVER["SCRIPT_FILENAME"], $_SERVER["PHP_SELF"])))) {

And replace it with this one:

if (!((is_file($_SERVER["SCRIPT_FILENAME"])))) {

Hopefully a new version of Cacti is out soon that fixes this problem.


del.icio.us:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  digg:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  spurl:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  wists:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  simpy:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  newsvine:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  blinklist:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  furl:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  reddit:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  fark:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  blogmarks:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  Y!:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  smarking:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  magnolia:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  segnalo:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path  gifttagging:Cacti 0.8.7b on FreeBSD - Invalid PHP_SELF Path

Possibly related posts

Post a Comment