Post by Khal » Thu Mar 03, 2016 6:20 pm

My hosting company recently moved my site to a new server and since then I have been getting lots of error messages and I am unable to install extensions through the Extension Installer.

I get this error message when trying to install a module through the Extension Installer:

Code: Select all

    SyntaxError: JSON.parse: unexpected character
    OK
    <b>Warning</b>: Invalid argument supplied for foreach() in <b>/var/sites/k/khaleejiabaya.com/public_html/admin/controller/extension/installer.php</b> on line <b>333</b><b>Warning</b>: ftp_mkdir(): Can't create directory: File exists in <b>/var/sites/k/khaleejiabaya.com/public_html/admin/controller/extension/installer.php</b> on line <b>338</b><b>Warning</b>: Invalid argument supplied for foreach() in <b>/var/sites/k/khaleejiabaya.com/public_html/admin/controller/extension/installer.php</b> on line <b>333</b><b>Warning</b>: ftp_mkdir(): Can't create directory: File exists in <b>/var/sites/k/khaleejiabaya.com/public_html/admin/controller/extension/installer.php</b> on line <b>338</b>{"error":"Could not change to directory vendors"}

I have looked at my config file and I think the path at the front seems incorrect? Here it is:

Code: Select all

    <?php
    if($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {

    $_SERVER['HTTPS'] = 'on';

    $_SERVER['SERVER_PORT'] = 443;

    }
    // HTTP
    define('HTTP_SERVER', 'https://khaleejiabaya.com/');

    // HTTPS
    define('HTTPS_SERVER', 'https://khaleejiabaya.com/');

    // DIR
    define('DIR_APPLICATION', '/var/sites/k/khaleejiabaya.com/public_html/catalog/');
    define('DIR_SYSTEM', '/var/sites/k/khaleejiabaya.com/public_html/system/');
    define('DIR_LANGUAGE', '/var/sites/k/khaleejiabaya.com/public_html/catalog/language/');
    define('DIR_TEMPLATE', '/var/sites/k/khaleejiabaya.com/public_html/catalog/view/theme/');
    define('DIR_CONFIG', '/var/sites/k/khaleejiabaya.com/public_html/system/config/');
    define('DIR_IMAGE', '/var/sites/k/khaleejiabaya.com/public_html/image/');
    define('DIR_CACHE', '/var/sites/k/khaleejiabaya.com/public_html/system/cache/');
    define('DIR_DOWNLOAD', '/var/sites/k/khaleejiabaya.com/public_html/system/download/');
    define('DIR_UPLOAD', '/var/sites/k/khaleejiabaya.com/public_html/system/upload/');
    define('DIR_MODIFICATION', '/var/sites/k/khaleejiabaya.com/public_html/system/modification/');
    define('DIR_LOGS', '/var/sites/k/khaleejiabaya.com/public_html/system/logs/');

 
I am also getting lots of different errors in my log with the the same path "var/sites/k/khaleejiabaya.com":

Code: Select all

unlink(/var/sites/k/khaleejiabaya.com/public_html/system/cache/cache.zone.223.1456928503): No such file or directory in /var/sites/k/khaleejiabaya.com/public_html/system/library/cache/file.php on line 17

PHP Warning:  session_start(): Cannot send session cache limiter - headers already sent (output started at /var/sites/k/khaleejiabaya.com/public_html/index.php:105) in /var/sites/k/khaleejiabaya.com/public_html/system/library/session.php on line 12

PHP Warning:  Cannot modify header information - headers already sent by (output started at /var/sites/k/khaleejiabaya.com/public_html/index.php:105) in /var/sites/k/khaleejiabaya.com/public_html/catalog/controller/common/seo_pro.php on line 78

fopen(/var/sites/k/khaleejiabaya.com/public_html/system/cache/cache.product.seopath.1456940064): failed to open stream: No such file or directory in /var/sites/k/khaleejiabaya.com/public_html/system/library/cache/file.php on line 28

PHP Warning:  filesize(): stat failed for /var/sites/k/khaleejiabaya.com/public_html/system/cache/cache.product.seopath.1456940064 in /var/sites/k/khaleejiabaya.com/public_html/system/library/cache/file.php on line 32
I never have this path in front of the /public_html dir before migrating to new server. Is this the issue? I don't really want to try to change anything myself because I don't know what I'm doing.

I would really appreciate it if anyone can help get things working properly again. I can provide ftp details and admin access on request.

Many thanks

OC2.0.1.1
https://KhaleejiAbaya.Com
Last edited by Khal on Sun Mar 06, 2016 9:05 pm, edited 1 time in total.

OC 2.0.1.1


Active Member

Posts

Joined
Thu May 24, 2012 9:24 pm
Location - Teesside, UK

Post by paulfeakins » Thu Mar 03, 2016 6:24 pm

It sounds to me like the server you moved to has a newer version of PHP which has some stricter settings and is generating warnings.

Perhaps you can ask your web host to match the PHP version?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by Khal » Thu Mar 03, 2016 6:37 pm

Hi Paul

Thanks for getting back to me. I have downgraded my PHP version to a lower version. But I am still unable to install extensions through the Extension Installer. Halfway through the transfer, the installer just stops working and I still get these two errors in my log:

Code: Select all

PHP Warning:  Invalid argument supplied for foreach() in /var/sites/k/khaleejiabaya.com/public_html/admin/controller/extension/installer.php on line 333

PHP Warning:  ftp_mkdir() [<a href='function.ftp-mkdir'>function.ftp-mkdir</a>]: Can't create directory: File exists in /var/sites/k/khaleejiabaya.com/public_html/admin/controller/extension/installer.php on line 338
I have searched the forums and google and can't find a solution. Everything was working fine before the server migration so I don't know what's changed.

Any help would be greatly appreciated.

OC 2.0.1.1


Active Member

Posts

Joined
Thu May 24, 2012 9:24 pm
Location - Teesside, UK

Post by paulfeakins » Fri Mar 04, 2016 6:50 pm

Khal wrote:I have downgraded my PHP version to a lower version.

But what version? Is it now exactly the same as the old server?
Khal wrote:

Code: Select all

PHP Warning:  Invalid argument supplied for foreach() in /var/sites/k/khaleejiabaya.com/public_html/admin/controller/extension/installer.php on line 333[/quote]
What can you see in /admin/controller/extension/installer.php line 333?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by Khal » Fri Mar 04, 2016 7:03 pm

I'm now on PHP 5.3. My hosting company said this is what I was on before.

The line on /admin/controller/extension/installer.php line 333 is:

Code: Select all

if (substr($destination, 0, 6) == 'system') {
								$destination = basename(DIR_SYSTEM) . substr($destination, 6);
I am also getting this error now when I receive an order:

Code: Select all

PHP Notice:  Use of undefined constant CURLOPT_POSTREDIR - assumed 'CURLOPT_POSTREDIR' in /var/sites/k/khaleejiabaya.com/public_html/system/modification/admin/controller/sale/order.php on line 1505

2016-03-04 10:58:43 - PHP Warning:  curl_setopt() expects parameter 2 to be long, string given in /var/sites/k/khaleejiabaya.com/public_html/system/modification/admin/controller/sale/order.php on line 1505
The line is:

Code: Select all

curl_setopt($curl, CURLOPT_POSTREDIR, 7);
My hosting company said the PHP version should not make a difference when uploading files via ftp. Any ideas to what else it can be please?

Many thanks for your help.

OC 2.0.1.1


Active Member

Posts

Joined
Thu May 24, 2012 9:24 pm
Location - Teesside, UK

Post by Khal » Sun Mar 06, 2016 8:22 pm

It seems my hosting on this new server did not have ftp support. I used this fix and the issue with the Extension Installer seems to be resolved now (hopefully).
Hope it will help someone else having the same problems when changing server.

OC 2.0.1.1


Active Member

Posts

Joined
Thu May 24, 2012 9:24 pm
Location - Teesside, UK

Post by pprmkr » Sun Mar 06, 2016 9:03 pm

Code: Select all

curl_setopt($curl, CURLOPT_POSTREDIR, 7);
This line of code is not used in admin/controller/sale/order.php by default.
It must have been added by an extension / modification. Contact developer of that extension.

And please mask your database login in your first post !!!

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by Khal » Sun Mar 06, 2016 9:48 pm

The errors with the order disappears after I went back to PHP v5.4

Thanks for letting me know that I was sharing my db login! Oops

OC 2.0.1.1


Active Member

Posts

Joined
Thu May 24, 2012 9:24 pm
Location - Teesside, UK
Who is online

Users browsing this forum: No registered users and 46 guests