{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/4900","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/4900/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/4900/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/4900/events","html_url":"https://github.com/facebook/hhvm/issues/4900","id":59027662,"number":4900,"title":"popen of hhvm versus php","user":{"login":"cpollett","id":429853,"avatar_url":"https://avatars.githubusercontent.com/u/429853?v=3","gravatar_id":"","url":"https://api.github.com/users/cpollett","html_url":"https://github.com/cpollett","followers_url":"https://api.github.com/users/cpollett/followers","following_url":"https://api.github.com/users/cpollett/following{/other_user}","gists_url":"https://api.github.com/users/cpollett/gists{/gist_id}","starred_url":"https://api.github.com/users/cpollett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpollett/subscriptions","organizations_url":"https://api.github.com/users/cpollett/orgs","repos_url":"https://api.github.com/users/cpollett/repos","events_url":"https://api.github.com/users/cpollett/events{/privacy}","received_events_url":"https://api.github.com/users/cpollett/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-26T06:36:48Z","updated_at":"2015-03-14T00:04:06Z","closed_at":"2015-03-14T00:04:06Z","body":"I installed hhvm Feb 21 using apt-get and am running apache and fast-cgi. I ran into an issue that I isolated into the following test case. Consider the three files:\r\n\r\ntest2.php:\r\n\r\n<?php\r\nfile_put_contents('/var/www/yo.txt', 'hi there');\r\n?>\r\n\r\ntest1a.php\r\n\r\n<?php\r\necho \"Fork Test\";\r\n$fork = \"/usr/bin/hhvm -f '/var/www/test2.php' < /dev/null > /dev/null &\";\r\npclose(popen($fork, \"r\"));\r\n?>\r\n\r\ntest1b.php\r\n\r\n<?php\r\necho \"Fork Test\";\r\n$fork = \"/usr/bin/php -f '/var/www/test2.php' < /dev/null > /dev/null &\";\r\npclose(popen($fork, \"r\"));\r\n?>\r\n\r\nIf I run test1a.php or test1b.php from the command line using hhvm it makes the file yo.txt as expected.\r\nThe web server has permissions on /var/www. When I run test1a.php from the server\r\nit doesn't work, but test1b.php does. The\r\npcntl_sigprocmask(SIG_UNBLOCK, array(SIGCHLD));\r\nsuggestion mention in issue 3506 did not make it work, so as suggested there I am making  a new issue. The original place where the problem arose is in my search engine which may launch php subprocesses for fetching, etc. I was trying to see to what degree I could get it to run under hhvm. The code can be found at:\r\ngit clone https://seekquarry.com/git/yioop.git\r\ndocumentation is at:\r\nhttp://seekquarry.com/\r\nIn particular, the start() method in the file  lib/crawl_daemon.php seems to be affected by this. \r\n\r\nBest,\r\nChris"},"comment":{"url":"https://api.github.com/repos/facebook/hhvm/issues/comments/79546843","html_url":"https://github.com/facebook/hhvm/issues/4900#issuecomment-79546843","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/4900","id":79546843,"user":{"login":"cpollett","id":429853,"avatar_url":"https://avatars.githubusercontent.com/u/429853?v=3","gravatar_id":"","url":"https://api.github.com/users/cpollett","html_url":"https://github.com/cpollett","followers_url":"https://api.github.com/users/cpollett/followers","following_url":"https://api.github.com/users/cpollett/following{/other_user}","gists_url":"https://api.github.com/users/cpollett/gists{/gist_id}","starred_url":"https://api.github.com/users/cpollett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpollett/subscriptions","organizations_url":"https://api.github.com/users/cpollett/orgs","repos_url":"https://api.github.com/users/cpollett/repos","events_url":"https://api.github.com/users/cpollett/events{/privacy}","received_events_url":"https://api.github.com/users/cpollett/received_events","type":"User","site_admin":false},"created_at":"2015-03-14T00:04:06Z","updated_at":"2015-03-14T00:04:06Z","body":"I think I figured out my own problem. The issue seemed to be that when run under the web server,\r\nhhvm was trying to create a .hhvm.hhbc file under the user that runs the webserver home directory, in this case /var/www, and it didn't have permissions to do this. So this wasn't really a bug in hhvm's popen, more a bug in my understanding of how it starts up."}}