I am using WP-MINIFY wordpress plugin on my small Wordpress blog but due to my server's security designs, fpassthru() function is disable. So, i must find another way, in order to edit wordpress plugin.

I am getting this error on minified files :


Warning: fpassthru() continues to be disabled for security reasons in /home/blablabla/public_html/wordpress-content/plug ins/wordpress-minify/min/lib/Minify/Cache/File.php online 84

This is actually the function which using fpassthru :

/**
 * Send the cached content to output
 *
 * @param string $id cache id (e.g. a filename)
 */
public function display($id)
{
    if ($this->_locking) {
        $fp = fopen($this->_path . '/' . $id, 'rb');
        flock($fp, LOCK_SH);
        fpassthru($fp);
        flock($fp, LOCK_UN);
        fclose($fp);
    } else {
        readfile($this->_path . '/' . $id);            
    }
}

Have you got any idea?

echo stream_get_contents($fp);

(rather than the fpassthru line) does exactly the same factor, just with more memory consumption (and fewer enhanced than fpassthru).

You could utilize:

public function display($id)
{
    $filename=$this->_path . '/' . $id;
    if ($this->_locking) {
        $fp = fopen($filename, 'rb');
        flock($fp, LOCK_SH);
        //fpassthru($fp);
        $out=fread($fp,filesize($filename));
        echo $out;
        flock($fp, LOCK_UN);
        fclose($fp);
    } else {
        readfile($filename);            
    }
}