Nginx-php failed to open Stream:too many open files in

Source: Internet
Author: User
  warning:require_once (/mnt/hgfs/www/open/test/requests-master/ library/requests/exception.php): Failed to open stream:too many open files in/mnt/hgfs/www/open/test/requests-master/ library/requests.php on line 136PHP Fatal error:require_once (): Failed opening required '/mnt/hgfs/www/open/test/reques Ts-master/library/requests/exception.php ' (include_path= '.:/ Usr/local/php/lib/php ') in/mnt/hgfs/www/open/test/requests-master/library/requests.php on line 136Fatal error: Require_once (): Failed opening required '/mnt/hgfs/www/open/test/requests-master/library/requests/exception.php ' ( Include_path= '.:/ Usr/local/php/lib/php ') in/mnt/hgfs/www/open/test/requests-master/library/requests.php on line 136  
// 从数据库取出一篇文章include '../Requests-master/Request.php';$article_cond='some cond';$article=$db->fetchByCond($article_cond)while($article){    $return=Request::post($url,$data,$header);    // do others    $article=$db->fetchByCond($article_cond);}

The following is an error in this file

public static function autoloader($class) {        // Check that the class starts with "Requests"        if (strpos($class, 'Requests') !== 0) {            return;        }        $file = str_replace('_', '/', $class);        if (file_exists(dirname(__FILE__) . '/' . $file . '.php')) {            // 下面这行是136行            require_once(dirname(__FILE__) . '/' . $file . '.php');        }    }

Remove the article from the database, and then use PHP requests the library to insert the article into the database on another server (this is all 127.0.0.1). Do not know what will appear this problem, each insert 1020 article will appear this problem, do not know where to set the problem?

Reply content:

  warning:require_once (/mnt/hgfs/www/open/test/requests-master/ library/requests/exception.php): Failed to open stream:too many open files in/mnt/hgfs/www/open/test/requests-master/ library/requests.php on line 136PHP Fatal error:require_once (): Failed opening required '/mnt/hgfs/www/open/test/reques Ts-master/library/requests/exception.php ' (include_path= '.:/ Usr/local/php/lib/php ') in/mnt/hgfs/www/open/test/requests-master/library/requests.php on line 136Fatal error: Require_once (): Failed opening required '/mnt/hgfs/www/open/test/requests-master/library/requests/exception.php ' ( Include_path= '.:/ Usr/local/php/lib/php ') in/mnt/hgfs/www/open/test/requests-master/library/requests.php on line 136  
// 从数据库取出一篇文章include '../Requests-master/Request.php';$article_cond='some cond';$article=$db->fetchByCond($article_cond)while($article){    $return=Request::post($url,$data,$header);    // do others    $article=$db->fetchByCond($article_cond);}

The following is an error in this file

public static function autoloader($class) {        // Check that the class starts with "Requests"        if (strpos($class, 'Requests') !== 0) {            return;        }        $file = str_replace('_', '/', $class);        if (file_exists(dirname(__FILE__) . '/' . $file . '.php')) {            // 下面这行是136行            require_once(dirname(__FILE__) . '/' . $file . '.php');        }    }

Remove the article from the database, and then use PHP requests the library to insert the article into the database on another server (this is all 127.0.0.1). Do not know what will appear this problem, each insert 1020 article will appear this problem, do not know where to set the problem?

Too Many open files, this hint is very clear, the development of too many files.

The number of files opened by a process is capped, cannot exceed this value, require_once is to open the file, so there is an error.

Back to your question, simple require should not reach the file open limit, two directions to check the problem it

    1. Is there a problem with cyclic require?

    2. Are there too many open files in other locations and no close?

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.