#16340: PHP throwing fork()ing error ----------------------------------+----------------------------------------- Reporter: cabanela@mnstate.edu | Owner: macports-tickets@lists.macosforge.org Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.6.0 Keywords: | ----------------------------------+----------------------------------------- Honestly, I think this error is in the OS (or its origin is), but I am sitting here pulling my hair out. I have several PHP scripts that call a PHP package called JpGraph to generate graphs. I should not I had been using Apple's built-in PHP and APache servers. Since upgrading to Leopard, the following error is recorded in the Apache2 error_log {{{ The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug. }}} I discovered that the PDFLIb folks have documented this problem a little better, copying from their documentation here == http://www.pdflib.com/fileadmin/pdflib/pdf/support/PDFlib-in-PHP- HowTo.pdf == ''Apple’s PHP version which is bundled with Mac OS X does not work with PDFlib DSOs. To use PHP with PDFlib on Mac OS X you need third-party PHP packages such as MAMP, XAMP[P] for Mac, or Marc Liyanage’s version from www.entropy.ch. Mac OS X 10.5 (Leopard) adds new complications. As described in developer.apple.com/releasenotes/CoreFoundation/CoreFoundation.html it is no longer possible to use CoreFoundation functions after a call to fork( ) without exec( ). However, CoreFoundation functions are required for PDFlib’s host font feature, and the critical sequence above is used in the combination of Apache and PHP.'' I went ahead and installed Apache2 and PHP5 via MacPorts and configured them properly and discovered to my joy that my old graphics generating scripts were working... for 48 hours. My Mac locked up over the weekend (not sure why, it was the first time, maybe related), and when I reboot, I discovered now that the MacPorts PHP installation is now tossing the same errors. This has really confused me: 1. Can someone explain if the PDFLib folks were correct that you could avoid these errors with a non-Apple PHP installation or is this an unavoidable OS feature (which would make sense, I suppose)? 2. If this is avoidable, can someone with more PHP knowledge than me explain how to configure PHP to avoid "forking" in a manner offensive to Apple? -- Ticket URL: <http://trac.macports.org/ticket/16340> MacPorts <http://www.macports.org/> Ports system for Mac OS