Topic Closed
Eric
193 Posts
1.4K Downloads
1 Themes

It may be a setting issue in my local development server, or maybe the compiler is simply using too much memory. Once I changed php.ini from 32MB to 64MB, it worked fine. 

Allowed memory size of 33554432 bytes exhausted (tried to allocate 2416233 bytes)
    in: /Users/eric/Sites/gpeasy-43b2/include/thirdparty/less.php/Less.php
    on line: 233
    Request: /gpeasy-43b2/index.php/Admin_Theme_Content?cmd=preview_iframe&theme=Bootswatch_Flatly%28local%29%2F4_Sticky_Footer
    Method: GET

6 years ago#6639

Josh S.
2K Posts
267K Downloads
16 Themes
18 Plugins
Ah yes, LESS compiling takes a bit of memory. I'll be added some code to either increase memory or prevent LESS compilation.
6 years ago#6645

fly06
263 Posts
18.2K Downloads
1 Themes
8 Plugins

I have successfully installed gpEasy 4.3 RC1 on a remote server (fly06.w.pw).

But the server returns a '502 Bad Gateway' error.

The problem happens during the 'combine files' loop in the gpOutput::ParseLess() method.

 

 

Edited: 6 years ago#6690

Josh S.
2K Posts
267K Downloads
16 Themes
18 Plugins
The LESS compiler does use up a bit of memory (rest assured, it's results are cached so it's not running for every request). 4.3rc2 handles memory usage better than rc1, can you try that one?
6 years ago#6691

fly06
263 Posts
18.2K Downloads
1 Themes
8 Plugins

Sorry but the RC2 does not help.

Is there any way to switch the LESS compiler off?

 

 

 

6 years ago#6694

fly06
263 Posts
18.2K Downloads
1 Themes
8 Plugins

Some additional infos.

With the RC2 version, the problem happens during the getCss() call :

$compiled = $parser->getCss();

I cannot see any php error (the server just returns a 502 Bad Gateway) but the good news is that a lesscache file is stored in the /data/_cache/ dir.

Note that if I delete this file and reload the page, I get this warning:

Warning: Invalid argument supplied for foreach() in /home/u671512534/public_html/include/thirdparty/less.php/LessCache.php on line 153

Hope this helps.

 

 

6 years ago#6695

fly06
263 Posts
18.2K Downloads
1 Themes
8 Plugins

Latest news.

The problem happens within the getCss() method, at this line:

$evaldRoot = $root->compile($this->env);

The compile() method does return a Less_Tree_Ruleset object so something goes wrong during the assignment of the $evaldRoot variable. 

The memory usage is:

39944688 at the begining of the compile() method (initial call)
75107256 at the end of the same method just before the return statement

----------
Php version: 5.3.24
memory_limit: 128M

Edited: 6 years ago#6698

Josh S.
2K Posts
267K Downloads
16 Themes
18 Plugins

Hmm. A memory limit of 128M should be more than enough for the LESS compiler.

Is there any way to switch the LESS compiler off?

I'll have to look into that, but probably not a bad idea.

I cannot see any php error (the server just returns a 502 Bad Gateway) but the good news is that a lesscache file is stored in the /data/_cache/ dir.

Note that if I delete this file and reload the page, I get this warning

Warning: Invalid argument supplied for foreach() in /home/u671512534/public_html/include/thirdparty/less.php/LessCache.php on line 153

When you reload the page, does it display correctly?

6 years ago#6702

Josh S.
2K Posts
267K Downloads
16 Themes
18 Plugins
I've made a couple of changes that might help, can you try them out? I have made a release but the most recent code can be downloaded from github here: https://github.com/oyejorge/gpEasy-CMS/archive/master.zip
6 years ago#6705

Eric
193 Posts
1.4K Downloads
1 Themes

Is there any way to switch the LESS compiler off?

Maybe switching it between "manual" and "automatic" would be more appropriate, since the less compiler is only needed when changes are made to the code. In manual mode, the administrator could click a button when he/she wants to compile the LESS file.

Note: I understand we can have many CSS/LESS files based on the number of themes and layouts in a site. I have not thought it through completely.

6 years ago#6706

fly06
263 Posts
18.2K Downloads
1 Themes
8 Plugins

I've made a couple of changes that might help, can you try them out?

I could but I would be unable to say if it helps or not since the problem is solved now.

It might be possible that my hosting provider did fix it in the meantime.

I am still waiting for their feedback.

Is there any way to switch the LESS compiler off?

Since the Less.php script is quite a new (but very promising ;) project, it would be safe to make it optional in the 4.3 release.

PS: Not sure that the Less.php script is strictly compatible with php 5.2 due to the backward slashes before the Exception class.

 

 

 

Edited: 6 years ago#6707

Josh S.
2K Posts
267K Downloads
16 Themes
18 Plugins

PS: Not sure that the Less.php script is strictly compatible with php 5.2 due to the backward slashes before the Exception class.

Dang. I thought I removed all of those. Thank you!

I just finished testing the code on a system with PHP 5.2. There were some errors but everything is working now.

So, I've been looking over things and making LESS optional at this point in the process would be a bit difficult. I'll put out another release candidate with the latest fixes which should hopefully do the trick.

6 years ago#6710

fly06
263 Posts
18.2K Downloads
1 Themes
8 Plugins

I could but I would be unable to say if it helps or not since the problem is solved now.

Sorry but I was wrong.

I switched the php version from 5.3 to 5.2 and reloaded the page, it worked. 

Then I switched it back to 5.3 and it worked too but, of course, it was a misinterpretation since Less.php results are cached.

So the (hopefully) true test results (gpEasy 4.3 RC3) are:

  • Php 5.2 => Works fine
  • Php 5.3 => Does not work (some lesscache files are created but no css files)
  • Php 5.4 => Works fine

PS: I also got a Php Notice just after the installation is complete:

Notice: Undefined index: gpuniq in /home/u671512534/public_html/include/common.php on line 1258

 

 

6 years ago#6715

Josh S.
2K Posts
267K Downloads
16 Themes
18 Plugins

Php 5.3 => Does not work (some lesscache files are created but no css files)

Hmm. gpEasy.com is on php 5.3. Can you double check for any errors on the page or in the error log?

6 years ago#6716

Josh S.
2K Posts
267K Downloads
16 Themes
18 Plugins

Update: I set up another test system with php 5.3 and I'm getting some errors.

I believe the 5.3 installation isn't working because of the max_execution_time setting in php.

Edited: 6 years ago#6724

fly06
263 Posts
18.2K Downloads
1 Themes
8 Plugins

Can you double check for any errors on the page or in the error log?

As described above, I only get a 502 Bad Gateway error and the error log is empty.

Assuming that the server is behind a proxy, it seems that the connection between the server and the proxy breaks down during the Less.php execution.

I don't know more at this stage.

 

Edited: 6 years ago#6725

feniweb
297 Posts
​When will occur in style.less / * äöü Dalmatians * / in the file, the file is not loaded.
6 years ago#6728

Josh S.
2K Posts
267K Downloads
16 Themes
18 Plugins

@fly06

Looks like I was wrong about the max_execution_time setting. I tracked the problem down to the method_exists() function and the less compiler is working now in my alternate 5.3 environment. Would you mind checking with the most recent code?

@feniweb

When will occur in style.less / * äöü Dalmatians * / in the file, the file is not loaded.

Is that suppose to be a comment in the less file? If so remove the space in between the "/" and "*" characters so that it looks like this /* äöü Dalmatians */

 

6 years ago#6730

fly06
263 Posts
18.2K Downloads
1 Themes
8 Plugins

Would you mind checking with the most recent code?

It works great now w/ Php 5.3.

Very good job, thanks!

PS : method_exists() is also used in the core files gpOutput.php and finder.class.php

6 years ago#6731

Josh S.
2K Posts
267K Downloads
16 Themes
18 Plugins

Awesome, thanks so much for helping with this!

PS : method_exists() is also used in the core files gpOutput.php and finder.class.php

Those shouldn't be a problem. The issue in less.php was that the method_exists() function was doing double duty to check if a variable was an object and if an object had a method. We just had to add is_object() checks in front of method_exists().

6 years ago#6733

Topic Closed

 

News

Typesetter 5.1
8/12/2017

Typesetter 5.0.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

Over 8 Times Faster Than Wordpress
5/3/2016

We've known for a long time that Typesetter is fast. It's something we take pride ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register