Forum Support

Shape 5
September 25, 2021, 02:51:08 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Shape 5 Forum
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: errors when compress js or css is enabled  (Read 809 times)
cspub
Jr. Member
**
Offline Offline

Posts: 236



« on: March 18, 2014, 03:53:04 PM »

Our site is running slow when it was moved to another dedicated server where it belongs. I enabled js and css compression in the shape5 template features. when i did, it got errors on the page. i've attached a graphic with the errors. i had to turn the compression off as i didn't want customers seeing that. the site is back to normal now.

is there something else that needs to be done for this to work correctly? the site is http://www.salonandspagalleria.com
Logged
Tristan Rineer
Global Moderator
*****
Offline Offline

Posts: 3858

Gravatar


« Reply #1 on: March 19, 2014, 07:54:19 AM »

Those errors are most likely due to your php permissions being too restrictive.  For the compression to work, it needs to be able to open the files and compress the contents.

The compression is one of the parts of the core framework that I didn't have any involvement in coding, so I've forwarded the notification for this thread to one of the developers who did.

UPDATE:

I've received a response confirming what I thought; your php settings aren't allowing the compression script to create the cache files needed for it to function correctly.
« Last Edit: March 20, 2014, 07:32:38 AM by Tristan Rineer » Logged

Tristan Rineer
------------
Shape 5 Team



- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
cspub
Jr. Member
**
Offline Offline

Posts: 236



« Reply #2 on: March 19, 2014, 01:50:59 PM »

what do they need to be set at?
Logged
Tristan Rineer
Global Moderator
*****
Offline Offline

Posts: 3858

Gravatar


« Reply #3 on: March 20, 2014, 07:34:04 AM »

PHP needs to have file write permissions in order to read all the script files and create the "minified" version in the cache folder.
Logged

Tristan Rineer
------------
Shape 5 Team



- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
cspub
Jr. Member
**
Offline Offline

Posts: 236



« Reply #4 on: March 20, 2014, 08:11:19 AM »

i had the hosting company look at the logs and this is what they sent back to me. they said it isn't the permissions but in the code. i've marked out the folder and url below.

 it appears the issue is being caused by the HTTP wrapper being called from the file open statement:

=======================================================================================

[20-Mar-2014 04:06:34] PHP Warning: fopen(http://www.xxx/wp-content/themes/s5_new_vision/cache/bottom_compression_css.php) [<a href='function.fopen'>function.fopen[/url]]: failed to open stream: HTTP wrapper does not support writeable connections in /home/xxx/public_html/wp-content/themes/s5_new_vision/vertex/compression/bottom_css_and_js_compression.php on line 269
[20-Mar-2014 04:06:34] PHP Warning: fwrite(): supplied argument is not a valid stream resource in /home/xxx/public_html/wp-content/themes/s5_new_vision/vertex/compression/bottom_css_and_js_compression.php on line 275
[20-Mar-2014 04:06:34] PHP Warning: fclose(): supplied argument is not a valid stream resource in /home/xxx/public_html/wp-content/themes/s5_new_vision/vertex/compression/bottom_css_and_js_compression.php on line 277

=======================================================================================

Unfortunately because this request is being called using HTTP rather than opening the local file, you will not be able to write to it. This is not a restriction imposed by hosting company, but rather one by the PHP language itself. You will instead need to specify the local file path when writing the cached/compressed files.
Logged
Tristan Rineer
Global Moderator
*****
Offline Offline

Posts: 3858

Gravatar


« Reply #5 on: March 21, 2014, 03:01:22 PM »

From the fopen function page on PHP.net:

Quote
If PHP has decided that filename specifies a registered protocol, and that protocol is registered as a network URL, PHP will check to make sure that allow_url_fopen is enabled. If it is switched off, PHP will emit a warning and the fopen call will fail.

That means that the error you are having is caused by a server setting called "allow_url_fopen".  All Vertex releases (including the Joomla ones) use the same files for the compression functions; if it was a problem with the code, it would have already been fixed, as that feature was introduced to Joomla long before WP.
« Last Edit: March 31, 2016, 09:06:19 AM by Tristan Rineer » Logged

Tristan Rineer
------------
Shape 5 Team



- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
cspub
Jr. Member
**
Offline Offline

Posts: 236



« Reply #6 on: March 30, 2016, 04:07:46 PM »

i had turned off compression since this never worked. still not working after upgrade. and other sites on same server running other templates from shape 5 work
Logged
Tristan Rineer
Global Moderator
*****
Offline Offline

Posts: 3858

Gravatar


« Reply #7 on: March 31, 2016, 09:13:04 AM »

It works fine on every server I have access to for testing, and as I stated above, it is related to a setting that you'll need to enable on your server.

From the fopen function page on PHP.net:

Quote
If PHP has decided that filename specifies a registered protocol, and that protocol is registered as a network URL, PHP will check to make sure that allow_url_fopen is enabled. If it is switched off, PHP will emit a warning and the fopen call will fail.

You may need to ask your host to enable the "allow_url_fopen" PHP setting, if you don't already know how to do it.  PHP configuration can be done a few different ways, depending on the way the host has it set up, so unfortunately, that's the most information I can provide about how to do it.
Logged

Tristan Rineer
------------
Shape 5 Team



- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Looking for the largest variety in template designs? Look no more. Never buy 1 theme again. Signups start at just $89 for access to all of our themes.
Send Us An Email
Please send us your questions and we will email you back as soon as we can. Product support questions should be posted in our support forums under the Help menu. Our staff will assist you from there.