Oh and one more thing. When I delete the line set_time_limit(0);, the error
stays the same
On Tuesday, September 17, 2013 2:33:59 PM UTC+2, Miloš Vučinić wrote:
>
> Hey guys,
>
> I am not usually asking for help, but this time I am desperate. I am
> running a Cake PHP app on a* safe mode php server*. And when I try to
> download a file using media view i get error Cannot set time limit in safe
> mode [CORE/Cake/Network/CakeResponse.php, line 1303 .
> So I delete that line just to see what will happen (maybe it can work
> without it or smth) upload the code and I get the same error, as if I
> haven't changed the code in /Cake/Network/CakeResponse.php . Then I thought
> I am editing the wrong files so I add a few echos and it works .. I am so
> confused...
>
> *The full error is here : *
> Warning (2): set_time_limit(): Cannot set time limit in safe mode
> [CORE/Cake/Network/CakeResponse.php, line 1303]Code Context
>
> set_time_limit - [internal], line ??
> CakeResponse::_sendFile() - CORE/Cake/Network/CakeResponse.php, line 1303
> CakeResponse::send() - CORE/Cake/Network/CakeResponse.php, line 415
> MediaView::render() - CORE/Cake/View/MediaView.php, line 98
> Controller::render() - CORE/Cake/Controller/Controller.php, line 948
> Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 194
> Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 162
>
> even tho the new function looks like this:
> /**
> * Reads out a file, and echos the content to the client.
> *
> * @param File $file File object
> * @return boolean True is whole file is echoed successfully or false if
> client connection is lost in between
> */
> protected function _sendFile($file) {
> $compress = $this->outputCompressed();
> $file->open('rb');
> while (!feof($file->handle)) {
> if (!$this->_isActive()) {
> $file->close();
> return false;
> }
> set_time_limit(0);
> echo fread($file->handle, 8192);
> if (!$compress) {
> $this->_flushBuffer();
> }
> }
> $file->close();
> return true;
> }
>
>
> *Is it possible that CakePHP cant be run under safe mode servers ? *
>
>
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.