Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4602558
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:00:17+00:00 2026-05-22T00:00:17+00:00

i have an application written in C++ that uses opencv 2.0, curl and a

  • 0

i have an application written in C++ that uses opencv 2.0, curl and a opensurf library. First a PHP script (cron.php) calls proc_open and calls the C++ application (called icomparer). When it finishes processing N images returns groups saying which images are the same, after that the script uses:

shell_exec('php cron.php > /dev/null 2>&1 &');  
die;

And starts again. Well, after 800 or 900 iterates my icomparer starts breaking. The system don’t lets me create more files, in icomparer and in the php script.

proc_open(): unable to create pipe Too many open files (2)
shell_exec(): Unable to execute 'php cron.php > /dev/null 2>&1 &'

And curl fails too:

couldn't resolve host name (6)

Everything crashes. I think that i’m doing something wrong, for example, I dunno if starting another PHP process from a PHP process release resources.

In “icomparer” I’m closing all opened files. Maybe not releasing all mutex with mutex_destroy… but in each iterator the c++ application is closed, I think that all stuff is released right?

What I have to watch for? I have tried monitoring opened files with stof.


  • Php 5.2
  • Centos 5.X
  • 1 GB ram
  • 120 gb hard disk (4% used)
  • 4 x intel xeon
  • Is a VPS (machine has 16 gb ram)
  • The process opens 10 threads and joins them.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:00:18+00:00Added an answer on May 22, 2026 at 12:00 am

    On Unix-alike systems, child processes inherit the open file descriptors of the parent. However, when the child process exits, it does close all of its copies of the open file descriptors but not the parent’s copies.

    So you are opening file descriptors in the parent and not closing them. My bet is that you are not closing the pipes returned by the proc_open() call.

    And you’ll also need to call proc_close() too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application written in PHP that uses a COM dll written in
I have written a PHP application that uses Objects heavily. Added, deleting, updating etc..
I have a PHP application that is written with Zend Framework. It uses Phing
We have a WinForms application written in C# that uses the AxAcroPDFLib.AxAcroPDF component to
I have a Qt application written in C++ that uses a SSL-connection (QSslSocket) with
I have written a web application that uses Microsoft's built-in membership authentication that is
I have written a little console application that uses s#arp. I can create an
I have a Windows Workflow application that uses classes I've written for COM automation.
I have an application written in MVC that uses your regular .Net Forms Authentication.
Greetings, We have an application written in .net 3.5 that uses wcf and also

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.