|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-04-11 11:13 UTC] nanocaiordo at gmail dot com
[2015-04-14 20:07 UTC] cmb@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: cmb
[2015-04-14 20:07 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 03:00:02 2025 UTC |
Description: ------------ getopt() return false when daemonizing a PHP script, $argv is properly filled up with all the arguments but getopt() keeps returning false. Calling the script without 'deamon --pidfile' does work, however something strange is that it outputs X-Powered-By and Content-type in CLI when getopt() fails. Test script: --------------- test.sh #!/bin/bash . /etc/rc.d/init.d/functions daemon --pidfile=test.pid test.php -P Pdegub test.php #!/usr/bin/env php <?php error_reporting(-1); ini_set('display_errors', 1); exit(var_dump(getopt('P:'))); Expected result: ---------------- sh ./test.sh array(1) { ["P"]=> string(6) "Pdebug" } Actual result: -------------- sh ./test.sh X-Powered-By: PHP/5.4.39 Content-type: text/html bool(false)