[Resolved] [Case 95621] Optimize Website - No longer working

lukapaunovic

Well-Known Member
Jul 29, 2012
52
3
58
Užice, Serbia
cPanel Access Level
Root Administrator
When client tries to enable or disable "Optimize Website" in cPanel, this error is shown:

Code:
OptimizeWS::optimizews(,) failed: Modification of non-creatable array value attempted, subscript -1 at /usr/local/cpanel/Cpanel/OptimizeWS.pm line 104, <HC> line 52.
I ran easyapache, didn't fix the issue.
Any fix? :confused:

Update:

I tried to fix /usr/local/cpanel/Cpanel/OptimizeWS.pm with Check/Repair a Perl Script
Didn't worked
Here is output:

Code:
-- Missing Cpanel::Serverinfo. Starting installation -- 

Checking C compiler....C compiler (/usr/bin/gcc) OK (cached Thu Apr  3 00:52:09 2014)
Tuned C compiler not available because it is not enabled....Done
Method: Using Perl Expect, Installer: cpanm
cpanm (App::cpanminus) 1.6916 on perl 5.010001 built for x86_64-linux-thread-multi
Work directory is /home/.cpanm/work/1396561300.819720
You have make /usr/bin/make
Falling back to HTTP::Tiny 0.029
You have /bin/tar: tar (GNU tar) 1.23
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
You have Cpanel::HttpRequest 2.1
Removing corrupted/broken cpan file /home/.cpan/sources/modules/03modlist.data.gz
Testing connection speed...(using fast method)....Done
Ping:0 (ticks) Testing connection speed to cpan.makeperl.org using pureperl...(cached .. 61800.00 bytes/s)...Done
Ping:0 (ticks) Testing connection speed to cpan.hexten.net using pureperl...(cached .. 56600.00 bytes/s)...Done
Ping:0 (ticks) Testing connection speed to www.planet-elektronik.de using pureperl...(cached .. 35100.00 bytes/s)...Done
Ping:0 (ticks) Testing connection speed to mirror.netcologne.de using pureperl...(cached .. 28200.00 bytes/s)...Done
Ping:1 (ticks) Testing connection speed to cpan.panu.it using pureperl...(cached .. 11500.00 bytes/s)...Done
Five usable mirrors located
Ping:9 (ticks) Testing connection speed to 208.43.108.66 using pureperl...(5790.00 bytes/s)...Done
Ping:10 (ticks) Testing connection speed to 216.38.56.98 using pureperl...(using cached speed)...Done
Ping:11 (ticks) Testing connection speed to 67.205.110.4 using pureperl...(using cached speed)...Done
Three usable fallback mirrors located
Fetching http://cpan.makeperl.org/index.html (connected:0).......(request attempt 1/12)...Resolving cpan.makeperl.org...(resolve attempt 1/65)......connecting to [email protected]%......request success......Done
Mirror Check passed for cpan.makeperl.org (/index.html)
Searching on cpanmetadb ...
Fetching http://cpanmetadb.cpanel.net/v1.0/package/Cpanel::Serverinfo (connected:0).......(request attempt 1/12)...Resolving cpanmetadb.cpanel.net...(resolve attempt 1/65)......connecting to [email protected].Error 404 while fetching URL http://cpanmetadb.cpanel.net//v1.0/package/Cpanel::Serverinfo
...skipping 208.74.124.130......server closed connection...Searching Cpanel::Serverinfo on cpanmetadb (http://cpanmetadb.cpanel.net/v1.0/package/Cpanel::Serverinfo) ...
Fetching http://cpanmetadb.cpanel.net/v1.0/package/Cpanel::Serverinfo (connected:0).......(request attempt 1/12)......connecting to [email protected].Error 404 while fetching URL http://cpanmetadb.cpanel.net//v1.0/package/Cpanel::Serverinfo
...skipping 208.74.124.130......server closed connection...Source: fastest CPAN mirror ... ! Couldn't find module or a distribution Cpanel::Serverinfo ()
Perl Expect failed with non-zero exit status: 256

CPAN fallback mode is active!
Method: Using Perl Expect, Installer: cpan
Testing connection speed...(using fast method).....Done
Ping:0 (ticks) Testing connection speed to cpan.makeperl.org using pureperl...(cached .. 61800.00 bytes/s)...Done
Ping:0 (ticks) Testing connection speed to cpan.hexten.net using pureperl...(cached .. 56600.00 bytes/s)...Done
Ping:0 (ticks) Testing connection speed to www.planet-elektronik.de using pureperl...(cached .. 35100.00 bytes/s)...Done
Ping:0 (ticks) Testing connection speed to mirror.netcologne.de using pureperl...(cached .. 28200.00 bytes/s)...Done
Ping:1 (ticks) Testing connection speed to cpan.panu.it using pureperl...(cached .. 11500.00 bytes/s)...Done
Five usable mirrors located
Ping:10 (ticks) Testing connection speed to 216.38.56.98 using pureperl...(using cached speed)...Done
Ping:11 (ticks) Testing connection speed to 67.205.110.4 using pureperl...(using cached speed)...Done
Ping:9 (ticks) Testing connection speed to 208.74.125.42 using pureperl...(using cached speed)...Done
Three usable fallback mirrors located
Mirror Check passed for cpan.makeperl.org (/index.html)
Disabling /bin/wget since LWP is available at /usr/local/cpanel/Cpanel/cPCPAN/Config.pm line 76.
Disabling /bin/ftp since Net::FTP is available at /usr/local/cpanel/Cpanel/cPCPAN/Config.pm line 81.
Unknown config variable 'gmake'
commit: wrote '/usr/share/perl5/CPAN/Config.pm'
Reading '/home/.cpan/Metadata'
  Database was generated on Thu, 03 Apr 2014 18:06:23 GMT
Warning: Cannot install Cpanel::Serverinfo, don't know what it is.
Try the command

    i /Cpanel::Serverinfo/

to find objects with matching identifiers.
CPAN: Time::HiRes loaded ok (v1.9721)
perlmod--Install done

The following modules were installed for /usr/local/cpanel/Cpanel/OptimizeWS.pm:
	Cpanel::Serverinfo

!! We have already tried to install Cpanel::Serverinfo. Please manually troubleshoot the installation of Cpanel::Serverinfo !!

Check Complete
 
Last edited:

vanessa

Well-Known Member
PartnerNOC
Sep 26, 2006
850
31
178
Virginia Beach, VA
cPanel Access Level
DataCenter Provider
Based on what the code on that line is trying to do, it's possible that perhaps your .htaccess is not writeable. Check .htaccess in public_html and make sure it's owned by user:user and is at least 644. Then tell cPanel how cute they are.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello :)

An internal case is open to address the issue you have reported. For reference, the case number is 95621. There is currently no time frame available on when a resolution might be released, but feel free to monitor the change log for that case number. One temporary workaround you could try is renaming the existing .htaccess file and then trying to enable/disable website optimization to see if it adds the correct entries. Remember to add back any additional entries to the .htaccess file (e.g. Mod_Rewrite rules).

Thank you.
 

cPanne

Quality Assurance Analyst
Staff member
Oct 4, 2011
10
0
126
Cypress, Texas, United States
cPanel Access Level
Website Owner
If you see this issue, there is no /home/[cPanel user]/.htaccess file or the /home/[cPanel user]/.htaccess file is completely empty

Here is a temporary solution:

To be certain you are not over-writing any existing data:
Code:
# mv /home/[cPanel user]/.htaccess /home/[cPanel user]/.htaccess.bak
To fix the issue with Optimize Website:
Code:
# echo  > /home/[cPanel user]/.htaccess; chown [cPanel user].[cPanel user] /home/[cPanel user]/.htaccess
cPanel >> Software/Services >> Optimize Website should work as expected once there is an existing .htaccess file with some content in /home/[cPanel user]/.htaccess
 

nunomigpe

Registered
Sep 12, 2013
3
0
1
cPanel Access Level
Root Administrator
Hi all

I try this solutions but i have something like:

.htaccess: Permission denied

I delete with Fillezilla with root login, in the cpanel etc... but the fille keeps appearing

Don´t know why

Best Regards
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
I delete with Fillezilla with root login, in the cpanel etc... but the fille keeps appearing
What permissions/ownership values is the file created with?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
The .htaccess file is required if you want to use the "Optimize Website" feature. Were you able to review this post to see if that helped?

Thank you.
 

egillette

Well-Known Member
Jan 5, 2010
72
0
56
Orlando, FL
cPanel Access Level
DataCenter Provider
Twitter
I have the same exact issue. . .

Here is the contents of my .htaccess file:

Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
In addition:

Code:
-rw-r--r--. 1 money money 236 Apr 15 17:42 .htaccess
And the public_html directory above it?

Code:
drwxr-xr-x.  8 money money  4.0K Apr 15 17:41 public_html/
cPanel user is obviously "money" -- I'm running Apache 2.x with MOD_RUID2 (security) and PHP as a DSO (speed).

This is actually the first server I've noticed this issue on. . .

Here is the output from httpd / php:

Code:
[email protected] [/home/money]# httpd -v
Server version: Apache/2.2.27 (Unix)
Server built:   Apr 10 2014 11:15:25
Cpanel::Easy::Apache v3.24.15 rev9999

[email protected] [/home/money]# php -v
PHP 5.3.28 (cli) (built: Apr 10 2014 11:21:59)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
    with eAccelerator v0.9.6.1-ea, Copyright (c) 2004-2012 eAccelerator, by eAccelerator
    with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube Ltd., and
    with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
[email protected] [/home/money]#
Please advise. . .
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Please keep in mind the .htaccess file at the root of the problem is not in the public_html directory. It's the .htaccess file within the /home/username directory. A resolution is scheduled for inclusion with a future build of cPanel, but in the meantime, I have verified that Anne's workaround in the post above works as intended.

Temporary Workaround for Case 95621

Thank you.
 

Serra

Well-Known Member
Oct 27, 2005
272
21
168
Florida
I too am seeing this problem. cPanel creates a lock file, but then can't do anything. I've tried creating an empty file and also tried deleting it turning it on without a file there.

Anyway, a work around is to take the code from another .htaccess and put it in the one you want to turn this on for and that will turn it on.
 

cPanelPeter

Senior Technical Analyst
Staff member
Sep 23, 2013
586
25
153
cPanel Access Level
Root Administrator
Hello,

Please don't just create an empty file (0 bytes). The file must be greater than 0.
So something like this:

Code:
# echo "" > /home/CPUSERNAME/.htaccess
should fix the issue. if your .htaccess file is NOT 0 bytes, then don't run the command above. It will erase everything within the file.