Home Forums
10 | 19 | 2021
JoomlaNook Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Getting imageflow to work
(0 viewing) 
Go to bottom
TOPIC: Getting imageflow to work
#1354
vervex3
Posts: 13
User Offline Click here to see the profile of this user
Re:Getting imageflow to work 12 Years, 11 Months ago  
Hi Ken,

After getting imageflow working on my development server - that didn't have the proper version of GD, which I commented on elsewhere - I ran into new problems with imageflow on a hosted server (but at least the GD was fine!). These new problems struck me as similar to those found in this lengthy thread.

In my case, the error conditions were memory related as reported: "PHP Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y) in reflection2.php." Note, had I not had error reporting ON, I might not have easily diagnosed the problem.

Since I am not able to alter php.ini on this particular host -I use them for want of cheap disk-space at the expense of not having shell access, which is great for a *working* photography site - I had to seek other solutions.

I was able to work around the problems by setting a directive inside the reflect2.php script (for when Transparent Reflections in the module is set to NO) and inside reflect3.php script (for when Transparent Reflections in the module are set to YES).

In reflection2.php, around line 108 I added:

Code:

//Increase php.ini imposed limits on memory available and on maximum execution time allowed for this script - clj / vervex3.com


Code:

ini_set('memory_limit', '256M');

Code:

ini_set('max_execution_time', '120'); 

Code:

$source_image = $params['img'];


In reflection3.php, around line 291 I added:
Code:

//Increase php.ini imposed limits on memory available and on maximum execution time allowed for this script - clj / vervex3.com


Code:

ini_set('memory_limit', '256M');

Code:

ini_set('max_execution_time', '120'); 


Code:

// We'll store the final reflection in $output. $buffer is for internal use.


In both cases, my host-configured php.ini file has values for memory and execution time of 64K and 30 seconds respectively.

I cant foresee whether this would work in every instance for every user - the host has to have compiled PHP with "enable-memory-limit" option set to TRUE. But I think that is fairly standard. Happily, I found no indication that these commands have any bad effects regardless of how the host compiled PHP - so maybe they are worthwhile adding to your code-base. You can certainly make it conditional by inspecting the PHP.INI values first.

Hope this helps you and others who may have hit similar anomalies.

Cheers,

Charles
 
Logged Logged
  The administrator has disabled public write access.
#1356
klowther
Admin
Posts: 3118
User Offline Click here to see the profile of this user
Gender: Male JoomlaNook Location: Fremont, NE USA Birthday: 07/23
Re:Getting imageflow to work 12 Years, 11 Months ago  
Hi Charles,

Thanks for the info. I will look into it. I do have a question though. Could you not have put your own php.ini file in the base directory of your hosted site? JoomlaNook is on a similar type server. In the past I had problems with the file upload settings that they had configured. I was able to get around these configuration shortcomings by setting up my own php.ini that overrode their settings.

Your suggestion is a good one and I could certainly make it a configurable option that could be enabled/disabled.

- Ken
 
Logged Logged
  The administrator has disabled public write access.
#1359
vervex3
Posts: 13
User Offline Click here to see the profile of this user
Re:Getting imageflow to work 12 Years, 11 Months ago  
klowther wrote:
Hi Charles,

Could you not have put your own php.ini file in the base directory of your hosted site? JoomlaNook is on a similar type server. In the past I had problems with the file upload settings that they had configured. I was able to get around these configuration shortcomings by setting up my own php.ini that overrode their settings.


- Ken


Hi Ken,

You can find a great discussion about PHP.INI options here: www.askapache.com/php/custom-phpini-tips-and-tricks.html. With respect to custom PHP.INI files, my take is that it depends on whether PHP is running as CGI or not. You can force that with some .htaccess directives, but if resorting to .htaccess (sometimes necessary, despite performance hits associated with .htaccess), one might as well alter the php.ini settings there - but then they apply across the board - when that may not be necessary or desirable in every instance i.e. I might have a specific upload script that I want to use to provide me great upload size limits, but I might not want my site visitors to have the same privilege - in that case, the script-specific approach offers far greater control.

In this specific case, my reasoning for the "per script" basis is that the method targets only these two memory intensive scripts and therefore doesn't tax the server unnecessarily - assuming that is the case when specified outside of the script itself (higher limits may not impose any greater load unless used - not sure about that). But, inasmuch as this host refuses to even change my max upload size from 2Mb (in this instance, I don't care - I FTP everything) I figure they might get testy if they found a more general work-around, but I doubt they'd notice, much less bother tracking "spikes" down to a particular script.

Lastly, this is the only application that I have found to suffer to the point of exhausted resources, so it seemed reasonable to take a more targeted approach.

I know my answer is general, and not comprehensive - my expertise only carries me so far.

To be sure, I don't encourage you to start programming workarounds for every possible server configuration issue. I really hope that posting my findings in your forum at least gives others a clue that it might not be your very fine software that's causing a problem. I would much rather you spend your time developing and rely on however many of us might have sufficient technical expertise to help out when a one-off problem that lurks about finally surfaces (there was, like, 10 pages of dialogue from this thread and I bet it all relates to this issue).

Lastly, I would like to expound mightily that you are a highly responsive and incredibly gracious Open Source Contributor - high into the 99th percentile for "best open source support!" You should be given as much help as possible by everyone.

Thanks again,

Charles
 
Logged Logged
  The administrator has disabled public write access.
#15143
kredytyogloszenia
Posts: 28
User Offline Click here to see the profile of this user
Kredyty Ogloszenia 4 Years, 1 Month ago  
Jestes doradca pienieznym czy tez kredytowym? Dodaj darmowo ogloszenie o Twoich uslugach i regionie dzialania. Pozyskaj wielu nowych klientów.

Ogloszenia finansowe - kredyty-ogloszenia.2em.pl to powyzej 100.000 odslon miesiecznie. Uzytkownicy to osoby poszukujace informacji na temat kazdego rodzaju kredytów, pozyczek, lokat czy ubezpieczen. Potencjalny uzytkownik to osoba mloda, przyzwoicie wyksztalcona i stabilna finansowo.

Dodanie ogloszenia jest zupelnie bezplatne. Jedynym warunkiem jest wyjatkowosc twojego ogloszenia tzn. nie moze ono miec odzwierciedlenia na zadnej innej stronie w internecie, otóz twoje ogloszenie finansowe musi byc autentyczne, nie moze byc kopia juz istniejacego ogloszenia.

Zapraszamy

kredyty-ogloszenia.2em.pl/pozyczki-bez-b...adluzonych-prywatne/
 
Logged Logged
  The administrator has disabled public write access.
#15147
kredytyogloszenia
Posts: 28
User Offline Click here to see the profile of this user
Kredyty Ogloszenia 4 Years, 1 Month ago  
Jestes doradca finansowym albo kredytowym? Dodaj za darmo ogloszenie o Twoich uslugach i obszarze dzialania. Zdobadz wielu nowych klientów.

Ogloszenia finansowe - kredyty-ogloszenia.2em.pl to ponad 100.000 odslon miesiecznie. Uzytkownicy to osoby poszukujace informacji na temat wszelakiego rodzaju kredytów, pozyczek, lokat czy ubezpieczen. Przypuszczalny uzytkownik to osoba mloda, przyzwoicie wyksztalcona i stateczna finansowo.

Dolozenie ogloszenia jest zupelnie darmowe. Jedynym wymogiem jest unikatowosc twojego ogloszenia tzn. nie moze ono miec odzwierciedlenia na zadnej innej stronie w internecie, otóz twoje ogloszenie finansowe musi byc autentyczne, nie moze byc kopia juz istniejacego ogloszenia.

Zapraszamy

kredyty-ogloszenia.2em.pl/poyczki-pozaba...mum-formalnoci-zamo/
 
Logged Logged
  The administrator has disabled public write access.
#15148
kredytyogloszenia
Posts: 28
User Offline Click here to see the profile of this user
Kredyty Ogloszenia 4 Years, 1 Month ago  
Jestes konsultantem pienieznym badz kredytowym? Dodaj bezplatnie ogloszenie o Twoich uslugach i obszarze dzialania. Zdobadz wielu nowych klientów.

Ogloszenia finansowe - kredyty-ogloszenia.2em.pl to powyzej 100.000 odslon miesiecznie. Odwiedzajacy to osoby poszukujace wiadomosci na temat wszelakiego rodzaju kredytów, pozyczek, lokat czy ubezpieczen. Przypuszczalny klient to osoba mloda, dobrze wyksztalcona i stateczna finansowo.

Dolozenie ogloszenia jest zupelnie bezplatne. Wylacznym warunkiem jest unikatowosc twojego ogloszenia tzn. nie moze ono miec odzwierciedlenia na zadnej innej stronie w internecie, otóz twoje ogloszenie finansowe musi byc oryginalne, nie moze byc kopia juz istniejacego ogloszenia.

Zapraszamy

kredyty-ogloszenia.2em.pl/poyczka-dla-firm-piotrkw-trybunalski/
 
Logged Logged
  The administrator has disabled public write access.
Go to top