Archive for December 2nd, 2008

Invalid PHP_SELF Path when upgrading to Cacti 0.8.7b on FreeBSD

When upgrading cacti to the latest version i always get bitten by my browser displaying the error “Invalid PHP_SELF Path” . Recently it happened when upgrading to Cacti 0.8.7b, but it also happened to me when upgrading to cacti-0.8.6j and cacti-0.8.7a. So i thought i better write about it here so you all can find the patch.

The fix is quite simple:

In /usr/local/share/cacti/includes/global.php, comment out (by prepending it with //) line 113 that looks like this:

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

And just after that line add this one instead:

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

Thats all you need to do to get your cacti working again.