I am running a WordPress blog using nginx + PHP + spawn-fcgi and it works fine, but once a day spawn-fcgi seems to crash.
I’ve just got the following error message while accessing the Inbound E-mail feature in SugarCRM:
Inbound Email cannot function without the IMAP c-client libraries enabled/compiled with the PHP module
To fix this error on my Debian server I’ve had to install the PHP IMAP module via
apt-get install php5-imap
Nice compiler Facebook developed and use for optimizing their web application.
HipHop for PHP transforms PHP source code into highly optimized C++. It was developed by Facebook and was released as open source in early 2010.
HipHop transforms your PHP source code into highly optimized C++ and then compiles it with g++ to build binary files. You keep coding in simpler PHP, then HipHop executes your source code in a semantically equivalent manner and sacrifices some rarely used features – such as eval() – in exchange for improved performance.
Facebook sees about a 50% reduction in CPU usage when serving equal amounts of Web traffic when compared to Apache and PHP. Facebook’s API tier can serve twice the traffic using 30% less CPU.
I just had the problem of checking with a PHP script if a process is still running on my Debian machine. I searched a little bit and found different approaches like this one in a posting of the php.net exec manual page:
function PsExists($pid) {
exec("ps ax | grep $pid 2>&1", $output);
while( list(,$row) = each($output) ) {
$row_array = explode(" ", $row);
$check_pid = $row_array[0];
if($pid == $check_pid) {
return true;
}
}
return false;
}
For me this seemed to be somehow too much code, so I used the following little approach for my script:
exec("ps -p $pid", $output);
if (count($output) > 1) {
// Process is running
}
This worked because ps -p PID will return information about the process if the PID is still active. And then the output array will have a length > 1.
Install it via
sudo apt-get install php5-tidy
Then use it for example this way:
$config = array(
'indent' => true,
'output-xhtml' => true,
'show-body-only' => true,
'wrap' => 0);
$tidy = new tidy;
$tidy->parseString($html_txt, $config, 'utf8');
$tidy->cleanRepair();
echo $tidy;
I needed to install phpize on my Ubuntu system
The phpize command is used to prepare the build environment for a PHP extension. [...]
and got the following error:
phpize not found
To solve this problem i needed to install the php5-dev package
sudo apt-get install php5-dev