littleconda Posted November 19, 2010 Share Posted November 19, 2010 Not sure this is 100% script related but this looks like a section that can help. I'm merging a script over from a old machine (i7) to a new machine (Atom) same OS (Gentoo amd64_x86) on both and both are emerged current. Both run PHP 5.3.3-pl1-gentoo (cli). On the orginal machine all is fine. when I attempt to run this script on the 2nd machine I get the following error, but it will run fine after the warnings. php hellavcr.php PHP Warning: fopen(/var/lock/hellavcr.pid): failed to open stream: Permission denied in /home/stivo/SERVER/hellavcr/hellavcr.php on line 1088 PHP Warning: flock() expects parameter 1 to be resource, boolean given in /home/stivo/SERVER/hellavcr/hellavcr.php on line 1089 PHP Warning: fwrite() expects parameter 1 to be resource, boolean given in /home/stivo/SERVER/hellavcr/hellavcr.php on line 1090 PHP Warning: fclose() expects parameter 1 to be resource, boolean given in /home/stivo/SERVER/hellavcr/hellavcr.php on line 1091 However if i run it without calling the ini file : php -n hellavcr.php all works well without any warnings. Anyone know off the top of their head what config I am missing in my php.ini file that would cause the above. I've attempted to diff them, but they don't match line for line and towards the end it's all showing different. I don't think It's the script causing me errors, just my config. For the curious , lines 1088-1091 $f = fopen($config['lock_file'], 'w'); flock($f, LOCK_EX); fwrite($f, posix_getpid() . "\n"); fclose($f); $config['pid_files'][] = $config['lock_file']; Thanks Quote Link to comment https://forums.phpfreaks.com/topic/219208-fopen-flock-flcose-errors-but-they-go-away-with-php-n-no-ini-file/ Share on other sites More sharing options...
mikosiko Posted November 19, 2010 Share Posted November 19, 2010 check the permits on /var/lock/hellavcr.pid Quote Link to comment https://forums.phpfreaks.com/topic/219208-fopen-flock-flcose-errors-but-they-go-away-with-php-n-no-ini-file/#findComment-1136915 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.