开发者

Understanding why exec($my_command) hang

开发者 https://www.devze.com 2022-12-30 14:55 出处:网络
I have an exec() call wich never end, and my Apache/PHP process is blocked until timeout. It\'s an PostgreSQL database load like that

I have an exec() call wich never end, and my Apache/PHP process is blocked until timeout. It's an PostgreSQL database load like that

"C:\Program Files\PostgreSQL\8.3\bin"\psql --host 127.0.0.1 --dbname unitTests --file C:\ZendStd\www\voo4\trunk\resources\sql\base_test_projectx.pg.sql --username postgres 2>&1

It run fine in command line, but just block when called via php exec() function. I just want to understand why my exec() call never end, I think psql ask for a password but how I can开发者_高级运维 print the output before the call end?

I use PHP 5.2.12 on Windows XP, with PGSql 8.3.


You could use passthru() which directly outputs everything. Or you use some process control functions.

0

精彩评论

暂无评论...
验证码 换一张
取 消