Understanding why exec ($ my_command) hangs

I have an exec () call that never ends and my Apache / PHP process is blocked until it timeouts. It is a PostgreSQL database like this

"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 works fine on the command line, but just blocks when called through the php exec () function. I just want to understand why my exec () call never ends, I think psql is asking for a password, but how can I print the output to the end of the call?

I am using PHP 5.2.12 on Windows XP with PGSql 8.3.

+2


a source to share


1 answer


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



+2


a source







All Articles