2013-04-28 7 views
18

मैंने this आलेख का उपयोग करते हुए उबंटू 32-बिट 12.10 पर चल रहे मेरे PHP 5.4.6 पर pcntl स्थापित किया है।पीसीएनएलएल सुरक्षा कारणों से उबंटू पर काम नहीं कर रहा है

यह आसानी से नहीं चला क्योंकि संकलन के बाद, make test चलाते समय मुझे निम्न त्रुटियां मिलीं।

चेतावनी:: pcntl_fork() /var/www/mydev/dev/mailServiceTest.php में सुरक्षा कारणों से अक्षम कर दिया गया है मैं हर बार है कि मैं एक बच्चे प्रक्रिया है जो कहते हैं कांटा करने के लिए कोशिश कर रहा हूँ एक चेतावनी हो रही है लाइन 8

मैंने समाधान के लिए पूरे वेब पर खोज की है, लेकिन दुर्भाग्य से मुझे कहीं और इस समस्या का कोई उल्लेख नहीं मिला।

Build complete. 
Don't forget to run 'make test'. 
PHP Warning: Module 'pcntl' already loaded in Unknown on line 0 
PHP Warning: Module 'pcntl' already loaded in Unknown on line 0 

===================================================================== 
PHP   : /usr/bin/php 
Warning: Module 'pcntl' already loaded in Unknown on line 0 

PHP_SAPI : cli 
PHP_VERSION : 5.4.6-1ubuntu1.2 
ZEND_VERSION: 2.4.0 
PHP_OS  : Linux - Linux oleg-Lenovo-G580 3.5.0-26-generiC#42-Ubuntu SMP Fri Mar 8 23:20:06 UTC 2013 i686 
INI actual : /php/php-5.4.6/ext/pcntl/tmp-php.ini 
More .INIs : 
CWD   : /php/php-5.4.6/ext/pcntl 
Extra dirs : 
VALGRIND : Not used 
===================================================================== 
TIME START 2013-04-28 12:11:03 
===================================================================== 
FAIL Test pcntl wait functionality [tests/001.phpt] 
FAIL pcntl: pcntl_sigprocmask(), pcntl_sigwaitinfo(), pcntl_sigtimedwait() [tests/002.phpt] 
FAIL pcntl: SIG_BLOCK, SIG_UNBLOCK, SIG_SETMASK [tests/003.phpt] 
FAIL Bug #47566 (return value of pcntl_wexitstatus()) [tests/bug47566.phpt] 
FAIL pcntl_alarm() [tests/pcntl_alarm.phpt] 
FAIL pcntl_exec() [tests/pcntl_exec.phpt] 
FAIL pcntl_exec() 2 [tests/pcntl_exec_2.phpt] 
FAIL pcntl_exec() 3 [tests/pcntl_exec_3.phpt] 
FAIL Test function pcntl_fork() by calling it with its expected arguments [tests/pcntl_fork_basic.phpt] 
FAIL Test function pcntl_fork() by testing the process isolation in the forking hierarchy father -> son -> grandson where father can not knows his grandson [tests/pcntl_fork_variation.phpt] 
FAIL Test pcntl_get_last_error() [tests/pcntl_get_last_error.phpt] 
FAIL pcntl_signal() [tests/pcntl_signal.phpt] 
FAIL pcnt_signal_dispatch() [tests/pcntl_signal_dispatch.phpt] 
FAIL pcntl_wait() [tests/pcntl_wait.phpt] 
FAIL Closures as a signal handler [tests/signal_closure_handler.phpt] 
===================================================================== 
TIME END 2013-04-28 12:11:07 

===================================================================== 
TEST RESULT SUMMARY 
--------------------------------------------------------------------- 
Exts skipped : 0 
Exts tested  : 44 
--------------------------------------------------------------------- 

Number of tests : 15    15 
Tests skipped : 0 ( 0.0%) -------- 
Tests warned : 0 ( 0.0%) ( 0.0%) 
Tests failed : 15 (100.0%) (100.0%) 
Expected fail : 0 ( 0.0%) ( 0.0%) 
Tests passed : 0 ( 0.0%) ( 0.0%) 
--------------------------------------------------------------------- 
Time taken  : 4 seconds 
===================================================================== 

===================================================================== 
FAILED TEST SUMMARY 
--------------------------------------------------------------------- 
Test pcntl wait functionality [tests/001.phpt] 
pcntl: pcntl_sigprocmask(), pcntl_sigwaitinfo(), pcntl_sigtimedwait() [tests/002.phpt] 
pcntl: SIG_BLOCK, SIG_UNBLOCK, SIG_SETMASK [tests/003.phpt] 
Bug #47566 (return value of pcntl_wexitstatus()) [tests/bug47566.phpt] 
pcntl_alarm() [tests/pcntl_alarm.phpt] 
pcntl_exec() [tests/pcntl_exec.phpt] 
pcntl_exec() 2 [tests/pcntl_exec_2.phpt] 
pcntl_exec() 3 [tests/pcntl_exec_3.phpt] 
Test function pcntl_fork() by calling it with its expected arguments [tests/pcntl_fork_basic.phpt] 
Test function pcntl_fork() by testing the process isolation in the forking hierarchy father -> son -> grandson where father can not knows his grandson [tests/pcntl_fork_variation.phpt] 
Test pcntl_get_last_error() [tests/pcntl_get_last_error.phpt] 
pcntl_signal() [tests/pcntl_signal.phpt] 
pcnt_signal_dispatch() [tests/pcntl_signal_dispatch.phpt] 
pcntl_wait() [tests/pcntl_wait.phpt] 
Closures as a signal handler [tests/signal_closure_handler.phpt] 
===================================================================== 

You may have found a problem in PHP. 
This report can be automatically sent to the PHP QA team at 
http://qa.php.net/reports and http://news.php.net/php.qa.reports 
This gives us a better understanding of PHP's behavior. 
If you don't want to send the report immediately you can choose 
option "s" to save it. You can then email it to [email protected] later. 
Do you want to send this report now? [Yns]: y 

Please enter your email address. 
(Your address will be mangled so that it will not go out on any 
mailinglist in plain text): [email protected] 

Posting to http://qa.php.net/buildtest-process.php 

Thank you for helping to make PHP better. 
[email protected]:/php/php-5.4.6/ext/pcntl$ version 

जब निम्न आदेश टाइप, ऐसा लगता है पीएचपी वास्तव में पहले से स्थापित है कि, इससे पहले कि मैं इस विस्तार में सभी स्थापित हालांकि पीएचपी दुभाषिया समारोह को नहीं पहचाना:

[email protected]:/php/php-5.4.6/ext/pcntl$ php -m | grep pcntl 
PHP Warning: Module 'pcntl' already loaded in Unknown on line 0 
pcntl 

मैं कैसे कर सकता है इस सुविधा को ठीक से काम करने के लिए कॉन्फ़िगर करें?

+1

ठीक है, इसे 'अक्षम_फंक्शन' कॉन्फ़िगरेशन से हटा दें .... ('php -d disabled_functions = pcntl_fork -r' pcntl_fork(); ''या' php -d disabled_functions = substr -r 'substr (1); '' उस मामले के लिए)। ध्यान दें कि वेबसर्वर में कांटा करना बुरा विचार है। – Wrikken

+0

धन्यवाद, लेकिन मैं इस स्क्रिप्ट का उपयोग सीएलआई सैपी पर कर रहा हूं, इसलिए यह ठीक होना चाहिए –

उत्तर

37

sudo एडिट

sudo gedit /etc/php5/cli/php.ini 

या \ और

sudo gedit /etc/php5/apache2/php.ini खोज:

disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl 

टिप्पणी इस बाहर:

;disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl 
+7

एचएम, आपका _cli_ स्क्रिप्ट लोडिंग/आदि/php5/_apache2_ /php.ini क्यों है? – Wrikken

+1

यदि आपके पास * GUI का उपयोग करना है और रूट पहुंच की आवश्यकता है, तो इसके बजाय 'gksudo' का उपयोग करें: http://askubuntu.com/a/11766/63492 –

+0

हैलो आदित्य, निर्दिष्ट उत्तर आपकी होम निर्देशिका में फ़ाइलों को संपादित करने के बारे में बताता है एक सुपरसियर के रूप में, यह मामला यहां नहीं है, php.ini फ़ाइल का पहले से ही आपके वेब सर्वर उपयोगकर्ता (अपाचे के लिए www-data) का स्वामित्व है, या खराब स्थिति में खुद को रूट करके, लेकिन कभी भी आपके उपयोगकर्ता द्वारा नहीं। –

0

मैं भी इस समस्या थी एलईएम। /usr/share/php5 में कुछ नमूना PHP कॉन्फ़िगरेशन फ़ाइलों के साथ उबंटू जहाजों: php.ini-production अपाचे वेब सर्वर PHP कॉन्फ़िगरेशन (/etc/php5/apache2/php.ini) के लिए टेम्पलेट है और यह pcntl_fork और अन्य कार्यों को अक्षम करता है। php.ini-production.cli कमांड लाइन (/etc/php5/cli/php.ini) से PHP रन के लिए टेम्पलेट है, जिसमें आप परीक्षण चला रहे हैं, और यह किसी भी फ़ंक्शन को अक्षम नहीं करता है। लेकिन किसी भी तरह से मेरी /etc/php5/cli/php.ini अपाचे कॉन्फ़िगर की एक प्रति थी जो इन कार्यों को अक्षम करती है।

मुझे यकीन नहीं है कि यह कैसे हुआ। मैंने उबंटू 12.04 के साथ अपना लैंप स्टैक स्थापित किया। अक्टूबर 2013 से मेरी /etc/php5/cli/php.ini फ़ाइल, उबंटू 13.10 को स्थापित करने का सुझाव देती है; हो सकता है कि रिलीज ने गलत फाइल की प्रतिलिपि बनाई हो। उबंटू अपग्रेड /usr/share/php5 में नमूना फ़ाइलों को अपडेट करते हैं लेकिन फ़ाइलों को /etc/ में अकेले छोड़ दें।

यह मैं

$ sudo cp -pi /usr/share/php5/php.ini-production.cli /etc/php5/cli/php.ini 

इस्तेमाल किया डिफ़ॉल्ट कमांड लाइन सेटिंग्स फ़ाइल की प्रतिलिपि करने को ठीक करने के। जाहिर है अगर आपने कमांड लाइन PHP5 सेटिंग्स में बदलाव किए हैं, तो यह उन्हें ओवरराइट करेगा; भिन्न होने और उन्हें मर्ज करने के लिए अपने यूनिक्स कौशल का उपयोग करें।

संबंधित मुद्दे