Installing php extension broke my web service - page source is correct but not displaying

StackOverflow https://stackoverflow.com/questions/18220360

  •  24-06-2022
  •  | 
  •  

I attempted to install apc on my ubuntu 12.04 server. It worked, but I noticed that after installation, (using apt-get install ... ) the page no longer compiled correctly.

I looked in my error.log but I am not getting errors like I normally do. It appears to be compiling the php perfectly as normal. Also an IDENTICAL php file running on my local server works perfectly still.

I fully uninstalled apc (using apt-get remove & checking through php.ini), but it did not revert to its previous state. I think it may have something to do with buffering or an http client configuration error? I turned buffering on & restarted but it still doesn't work.

Are there any settings any of you might recommend? The source that the page outputs is the following:

 Invalid request, be sure to set all necessary keys.

Normally that shows up on the screen, but now the screen is just completely white.

Any ideas about what may have happened? I am hesitant to post the code or website address fully because it contains access to a database with confidential information.

EDIT: The page is returning a 404 page error.

有帮助吗?

解决方案

To investigate the change to the interpreter

Every noun that I type starting with a dollar sign, is a representation of a variable. I could make guesses but this is likely to make the analysis more complex. When I write "$afile", type one of the filenames in, from the previous listing.

login to your server (i am assuming SSH to a Unix box)
cd $whatever_your_doc_root_is
find . -name '*.php'
# this should give you a biiiiig list of files
php -l $afile
# should report any errors

The interesting errors don't have a line number or file name on them, and say "missing extension $blah" or similar.

# edit the file you just compiled to have the following at the top
# this is untested, but looks correct...

error_reporting(-1);
# bool handler ( int $errno , string $errstr [, string $errfile [, int $errline [, array $errcontext ]]] )
function h1($errno, $errstr, $errfile, $errline) {
     echo("$errfile#$errline: [$errno]$errstr\n");
     return true; 
} 
set_error_handler('h1'); 

then run individual files that don't alter the database or whatever.

To compile ALL the source

for x in `find . -name '*.php' ` do php -l $x; done

...This should run quite fast

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top