Jump to content

php from linux terminal


etnastyles

Recommended Posts

I wanted to know if php times out when run from the terminal???

I am trying to create a large file ftp drop box that uploads files and when the upload is completed an email is generated.

 

The issues i have come into is that php times out in the browser and set_time_limit is a bit of a hack!!!

 

thanks

 

etna

Link to comment
Share on other sites

I'm pretty sure that PHP will read the php.ini from wherever it's running. In php.ini, you'll find

max_execution_time = 30 ; or some other number

So you'll probably have to knock this number up a bit depending on your operation. Also might need to bump up the memory_limit or max_input_time.

Link to comment
Share on other sites

The issues i have come into is that php times out in the browser

This may not be php. It could be your web servers maximum execution time. CLI php will not time out. It will terminate if you script exhausts the maximum memory allowance. You cannot perform a file upload through CLI php. File uploads are achieved through HTTP. The file is processed once on the server by php.

Link to comment
Share on other sites

what do you guys think the best way of doing  a large upload without hacking the php.ini timeout, max ex and memory limit.

 

What about using php to exec ftp in linux from the command line???

 

do you think this would be possible or would the script that ran the exec suffer the timeout issues?

Link to comment
Share on other sites

  • 4 weeks later...

I would of thought execing an external system file wouldnt of timed out.

I run a local whois through a php script and sometimes the local whois takes forever without timing out.

 

 

Maybe try no hupping the program?

 

ie:

exec('nohup ftp some_other_code &');

 

 

 

or maybe just do it in perl to save some headache?

 

Link to comment
Share on other sites

Well the following in a htaccess file worked fine for me.

 

php_value upload_max_filesize 100M

php_value post_max_size 100M

 

I know its a hack. But it worked fine for me to allow people upload up to 100MB files.

The only other way would be to have a local client app developed using java etc to allow them to upload large files and to give a status of it.

 

-steve

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.