Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

popen is broken #4906

Closed
weltling opened this issue Feb 26, 2015 · 1 comment
Closed

popen is broken #4906

weltling opened this issue Feb 26, 2015 · 1 comment

Comments

@weltling
Copy link

======== /tmp/hhvm_chdir.php =======

<?php

$pwd = getcwd();
echo "in ".$pwd."\r\n";
chdir("/tmp/somedir");
echo "now in ".getcwd()."\r\n";

$r = popen("./bash_cmd", "r");
$s = fgets($r, 1024);
pclose($r);

var_dump($s);
?>

======== /tmp/somedir/bash_cmd =========

#!/bin/sh

echo $PWD

exit 0

=========== hhvm ================

hhvm hhvm_chdir.php
in /tmp
now in /tmp/somedir
sh: ./bash_cmd: No such file or directory
bool(false)

========== php ==================

php hhvm_chdir.php
in /tmp
now in /tmp/somedir
string(13) "/tmp/somedir
"
@paulbiss
Copy link
Contributor

I think we just need to pass the optional cwd argument to the LightProcess here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants