Jump to content

Prestashop 1.6 With Php 7.0 - Experience, Problems, Solutions


Recommended Posts

Hi,

Recently my hosting provider has added the new version of PHP 7.0.

I tried it.

So, here are my feedback (can be individual in your case).

 

Performance:

The site began to work better in form of speed. A bit faster response. Faster back office performance, product saving, etc.

 

Problems:

Started to get error 500 in the back office. This happens only when saving some preferences/admin. But everything works fine in products or categories.

 

Has anyone else tried PHP 7.0 ?

  • Like 1
Link to comment
Share on other sites

Hi, i also have experience use PHP 7 (PS 1.6.1.3).
My feeling are the same as Tanatus.
But i'm very sad, that when i saving same preferences/admin i see error 500.
 

Can anyone help to solve this problem or PS 1.6.1.3 do not support PHP 7?
  • Like 1
Link to comment
Share on other sites

 

Thank you for help so much!

 
But I'm not very experienced user , because I need some additional comments. Say me please where in project folder located files which i need change?

 

As indicated in the github:

yourwebsite.com/classes/

and edit the corresponding files.

Use FTP.

Link to comment
Share on other sites

We missed a spot :( . /classes/AdminTab.php needs to be changed on line 1099 as well. Use the same technique as the other patches and you'll be fine.

 

@razaro

PR 4503  has also been succesfully cherry-picked into 1.6.1.x branch.

 

PrestaShop has also been analyzed with php7cc: http://forge.prestashop.com/browse/PSCSX-7238. Most results were OK-ish. Most of the messages were caused by the outdated libraries that PrestaShop uses.

 

We're planning to make PrestaShop 1.6.1.4 compatible with PHP 7, so if you don't know how to apply the patches, you could also wait for the new version.

A good news  :D

Link to comment
Share on other sites

When you apply the initial fixes from mdekker's pull request I experience no problems with php7 RC7 and PS 1.6.1.3

 

The loading speed when seen from browser is much lower. I see ~200 ms page generation time for product pages, ~700-800 on product listings and index page with heavy modules. That's on average.

The server is litespeed with https, http2, 512 ram and more changes.

 

When benchmarking with speed insights, gt metrix and pingdom they don't give good improvement and give me ~4 seconds of loading which is not true. I can't say why....

Edited by the.rampage.rado (see edit history)
Link to comment
Share on other sites

  • 5 weeks later...

For me 1.6.1.4 is totally safe. I can't see blockers.

 

HELLOO PRESTASHOP TEAM, PLEASE CAN YOU FIX YOUR APC CACHING!?! APC IS DEAD, LONGLIVE APCU!!! Please can you fix this so we can use APCu and not relay on backwarcompatibility!

IT would be great!!!

Please vote for this so the team can hear!

Also is the forge currently supported and maintained?!

Link to comment
Share on other sites

I'm no programmer but I tried changing all apc_ to apcu_ as per the documentation but with no luck.

 

APCu is running on the server it's seen in phpinfo but it don't show up as option in Presta. Probably the function for checking if it's installed is different but I can't find which one is it. Also tried back-engeneering it from php_apc.c but with no luck also

Edited by the.rampage.rado (see edit history)
Link to comment
Share on other sites

Yes it is but backwardcompatibility HAVE to be installed and if it's not (as in my case) APCu is running but the system is not seeing it.

And -bc will be eventually dropped - why bring old code into the new version?


I think this will be my first pull request tomorrow! :)

Edited by the.rampage.rado (see edit history)
Link to comment
Share on other sites

And I also was using it before v5 but if we want to use php7 and v5 we have to install apc-bc. Which my current host 'have no power over'. Probably you have v <5 or backward compatibility installed.

So my idea is to add APCu-bc-less support to the list of core caches. And generally in future the whole APC class should drop because it was replaced but APCu will continue to be developed and used so the new cashing class using the new variables will be useful here. Why you need -bc if you can write for APCu >5 only (check for apcu and use it's variables)? The current state with this -bc is transition one.

Edited by the.rampage.rado (see edit history)
Link to comment
Share on other sites

Hi,

CSV import did not work - php 7.0.1, ps 1.6.1.4

ExampleCategoryName (ID: xx) nie może być zapisany
Property Category->name is empty
Przepisywanie URL nie powiodło się dla przyjaznego URL dla:
Przepisywany link dla (ID: xx) był przepisany jako friendly-url-autogeneration-failed.

after switching on php 5.6.16 it works ok.

Regards

Link to comment
Share on other sites

  • 2 weeks later...

 
Before coming to this conclusion, I tested with a 'fresh' copy of prestashop 1.6.1.4 on my mamp with php 7.0 and importing the sample data downloaded from the shop.
 I think I did not get an error message at first but when I used my own csv I did get, removing products in the shop while uploading new products I got it. After that  I tried again with the sample data later I got the same product property -> name is empty.

 

For both installations the problem was gone when I put the mamps php back on 5.6.10

 

I have trouble uploading the csv file, I get Error you aren't permitted to upload this kind of file,

 

For now I can only upload a snapshot of it.

The file works well again for me so I think it is not the problem but if you want it, tell me how to post or where to send it to.

 

post-1087600-0-70955900-1455987789_thumb.png

Link to comment
Share on other sites

I'm still on php 7

 

I entered our clients and they all have to log in by asking a new password, that goes well but if you want to change the password in 'my acount' it says that the new password is saved, but logging in with new password does not work. the old password is still active, something goes wrong writing data.

 

For us it does not work well yet.

Edited by [email protected] (see edit history)
Link to comment
Share on other sites

Hello

 

Some info on my experience With Prestashop 1.6.1.4 and PHP 7.x

 

Fresh install no mods.

 

I have one big problem, csv import does not work.

 

It cant same my products and URL rewrite fails too.

 

I changed back to PHP 5.xx and csv import worked again.

 

-

Carsten

Link to comment
Share on other sites

Need to be able to reproduce it first before I can go for a fix, but I'll give it another shot. Thanks @[email protected] for sharing your CSV!

 

Could you please also share the information from the page "Advanced parameters > Configuration information"? That would really help me a lot with getting insights on the platforms used!

Hello

 

As I wrote before I can export a csv file, but when I import the same file again, I get an error, empty name, can't rewrite URL

This happens with

 

Version: PHP 7.0.4

MySQL version: 5.6.29

Server software version: Apache

 

Works with

PHP version: 5.6.18

 

Best regards

Carsten

Link to comment
Share on other sites

Need to be able to reproduce it first before I can go for a fix, but I'll give it another shot. Thanks @[email protected] for sharing your CSV!

 

Could you please also share the information from the page "Advanced parameters > Configuration information"? That would really help me a lot with getting insights on the platforms used!

 

 I also switched back to php 5.x.x and all works well again (with the same .csv files) so I did not look into it anymore.

Although on my MAMP when I change the php version to php 7.0 it is easy to reproduce.

Here's a file of the config settings:

post-1087600-0-48600600-1457339597_thumb.png

 

With .csv I added 1 new product, see attachement to error message:

 

post-1087600-0-07276500-1457339978_thumb.png

Edited by [email protected] (see edit history)
Link to comment
Share on other sites

PHP5.4 vers PHP7

 

Pour faire fonctionner les tâches CRON sur OVH j'utilisais le fichier php5.4 suivant mais avec php7 il ne fonctionne plus, quelqu'un pourrais me dire quelles sont les modifications à apporter.

 

Merci :)

 

#!/usr/local/bin/php
<?php
error_reporting(E_ALL);
 
$break_line = (php_sapi_name() == "cli") ? chr(13) : '<br/>';
$urls = array(
);
echo $break_line.'Cron Report of '.date('Y-m-d H:i:s').$break_line.$break_line; 
foreach($urls as $key => $url) {
 
$output .= $break_line.'Job '.($key + 1).' : ';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
if($data = curl_exec($ch)) {
echo $break_line;
$output .= 'Ok';
}
else
$output .= 'Failed';
curl_close($ch);
}
die($output);
?>
 
 
Link to comment
Share on other sites

Those messages show up when you forget to configure the columns.

 

I'm not having any trouble importing the data on PHP 7.0.2, except for the image URLs not being available.

 

attachicon.gifcsvimport.png

What do you mean by configuring the columns?

You don't mean assigining the columns to the right label (like id and price eg.)?

 

Because that is all done well, as it works perfectly wel inserting all products into the shop with photo's and all (you can't get them cause shop is in maintanance).

I can replicate the issue by changing the php on my mamp and re start, the I get failure when trying to add a new product, when I switch back and restart then all works again.

It puzzles me.

 

Maybe because I have an upgraded version in stead of a fresh install of PS 1.6.1.4?

Edited by [email protected] (see edit history)
Link to comment
Share on other sites

Hello,

 

2 things for me to be able to use php 7.

Context : i'm on nginx + hhvm (php 7.xx) + mod pagespeed + mysql percona.

 

For the front end :

Nginx + hhvm, just a correction for classes/Link.php because hhvm is strict, with a fallback on php-fpm

For the back end

Nginx + php-fpm 5.6

 

And all is ok for me

Link to comment
Share on other sites

  • 6 months later...

PS 1.6.4.1 on LITESPEED server - no email is send out from BO or front after order completition.

 

Unknown error w linii 112 w pliku /home/ps/domains/psphp7/public_html/tools/pear/PEAR.php
[8192] Methods with the same name as their class will not be constructors in a future version of PHP; PEAR has a deprecated constructor

Unknown error w linii 829 w pliku /home/ps/domains/psphp7/public_html/tools/pear/PEAR.php
[8192] Methods with the same name as their class will not be constructors in a future version of PHP; PEAR_Error has a deprecated constructor
 

 

#EDIT

 

constructor change: public function __construct resolved this error but still no @ are send out

 

#EDIT 2

 

solved, some mail server policy prevented outgoing @ to be sent from dev env. when using prod. @ address

 

#EDIT 3

 

While mailing advanced smtp setting when saving:

Fatal error: Uncaught Error: Access to undeclared static property: Validate::$values in /home/ps/psphp7public_html/classes/controller/AdminController.php:1383 Stack trace: #0 /home/ps/psphp7/public_html/classes/controller/AdminController.php(897): AdminControllerCore->processUpdateOptions() #1 /home/ps/psphp7/public_html/classes/controller/Controller.php(178): AdminControllerCore->postProcess() #2 /home/ps/psphp7/public_html/classes/Dispatcher.php(367): ControllerCore->run() #3 /home/ps/psphp7/public_html/admin107prs/index.php(58): DispatcherCore->dispatch() #4 {main} thrown in /home/ps/psphp7/public_html/classes/controller/AdminController.php on line 1383

Edited by prestowicz (see edit history)
  • Like 1
Link to comment
Share on other sites

Hello,

 

2 things for me to be able to use php 7.

Context : i'm on nginx + hhvm (php 7.xx) + mod pagespeed + mysql percona.

 

For the front end :

Nginx + hhvm, just a correction for classes/Link.php because hhvm is strict, with a fallback on php-fpm

For the back end

Nginx + php-fpm 5.6

 

And all is ok for me

Arnaud,

I'm trying to use HHVM with Nginx but I'm having some CPU peaks when loading the store. Sometimes the HHVM process uses 100% of CPU.

 

I'm having problems with saving products on BO too.

 

And you?

 

Could you paste your server.ini configuration here, pls?

 

I'm using the latest version of Nginx and HHVM.

 

Thanks.

Link to comment
Share on other sites

Hello

 

Arnaud,
I'm trying to use HHVM with Nginx but I'm having some CPU peaks when loading the store. Sometimes the HHVM process uses 100% of CPU.

I'm having problems with saving products on BO too.

And you?

Could you paste your server.ini configuration here, pls?

I'm using the latest version of Nginx and HHVM.

Thanks.

 

It's a better solution you give your server.ini

 

hhvm is 3.9.10~wheezy

nginx is 1.9.4 built by gcc 4.7.2, OpenSSl 1.0.2d

 

The BO works fine with php 5.4.45-1~dotdeb+7.1 (cli)

Link to comment
Share on other sites

I'm using prestashop 1.6.1.1 with php7

 

I've done the fix from github ( first page in this thread)

 

it still won't work

Fatal error: 'continue' not in the 'loop' or 'switch' context in C:\xampp\htdocs\**********\classes\module\Module.php(1362) : eval()'d code on line 619
Fatal error: 'continue' not in the 'loop' or 'switch' context in C:\xampp\htdocs\***********\modules\posmegamenu\posmegamenu.php on line 619
Edited by prestashopnew (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

I've been trying to update to php7.0 in my prestashop site and with no satisfactory results.

 

I've installed on my Ubuntu 14.04 the php version 7.0 and when i'm trying to link with fpm's socket and restart nginx, the site returns me with no error but with a blank page. What could be the possible problems?

 

I'm running 1.6.1.0

 

Thanks

Link to comment
Share on other sites

Hi,

 

I've been trying to update to php7.0 in my prestashop site and with no satisfactory results.

 

I've installed on my Ubuntu 14.04 the php version 7.0 and when i'm trying to link with fpm's socket and restart nginx, the site returns me with no error but with a blank page. What could be the possible problems?

 

I'm running 1.6.1.0

 

Thanks

Back end works with php-fpm.

As i said : https://www.prestashop.com/forums/topic/494424-prestashop-16-with-php-70-experience-problems-solutions/page-3?do=findComment&comment=2283318

Link to comment
Share on other sites

Hello,

 

2 things for me to be able to use php 7.

Context : i'm on nginx + hhvm (php 7.xx) + mod pagespeed + mysql percona.

 

For the front end :

Nginx + hhvm, just a correction for classes/Link.php because hhvm is strict, with a fallback on php-fpm

For the back end

Nginx + php-fpm 5.6

 

And all is ok for me

 

Hi, thank you for your reply, but i think i'm not following.

What's hhvm? i've googled it and i have an idea of it that fastens php, but how does it exactly works? Does it work instead of php?

And how is possible to use 2 different versions of php for front and back office?

 

Thanks

Link to comment
Share on other sites

hello,

 

hhvm is a virtual machine developed to execute programs in php and developed by facebook. It works in JIT.

https://github.com/facebook/hhvm

 

And how to use 2 differents versions ?

- with nginx, and i say "in this path to use hhvm", "in this path to use php-fpm".

And as it wasn't enough, i said to nginx to have a fallback if hhvm is down, and so to use php-fpm.

 

Have you a linux dedicated server ? Do you use nginx ?

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 months later...

Appears to be an issue with SMTP mail under php 7 (using 7.0.16), TLS and SSL. When switching back to php 5.5 it works fine. php mail works. Error is: Error: Please check your configuration
Unable to connect with TLS encryption

 

Note: This issue may not be related to php version exactly. I am thinking server SSL crt. Will update when fixed.

 

ok an update on this for anyone experiencing swift mailer smtp issues with php 7 (and 5.6). There is nothing wrong with swift, version on presta 1.6.1.11 in my case. (blogs, etc will suggest you need to edit files to prevent this error, but that is incorrect), all you need to do is to properly install a cert on your server (mail server), it does not, as some suggest, need to be a CA. Self signed will work providing it is installed correctly.

Edited by jetx (see edit history)
Link to comment
Share on other sites

Problems:

Started to get error 500 in the back office. This happens only when saving some preferences/admin. But everything works fine in products or categories.

 

Has anyone else tried PHP 7.0 ?

 

 

 

Hi, i also have experience use PHP 7 (PS 1.6.1.3).

My feeling are the same as Tanatus.

But i'm very sad, that when i saving same preferences/admin i see error 500.

 

Can anyone help to solve this problem or PS 1.6.1.3 do not support PHP 7?

 

 

 

 

To fix error 500, you need to change Validate::$values['property'] to Validate::{$values['property']}. I wrote an article about Prestashop with PHP7 here : https://www.prestasoo.com/blog/fix-error-when-save-preferences-on-prestashop-with-php7.html

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...
  • 1 year later...

if you are running a serious shop then running non-compliant PHP on 1.6 is suicide.  

you won't know when/what or that an issue even occurred, you just make a complete mess.

if this is a hobby, yea go ahead and play around but no 'serious' shop manager would risk fall out from running a php version that PS does not specially support.

1.7 is 'far' superior to 1.6, so stop fighing what most do not have skills to solve, what happens when you load a module that is not complliant with php version?   It's caled things going bump in the night,

this is free advice (from a lot of experience), just upgrade your ps so you can run confidently on php 7.

 

Link to comment
Share on other sites

Of course any site adminstrator should know how to use DEV mode and read Error Logs. I'm not saying PHP is easy to fix.

 

On the other hand it's nowhere reasonable for a startup to migrate from 1.6 to 1.7. Buying a complete webshop with modules over again would also mean bankruptcy.

 

Prestashop 1.6.X is not a bad platform at all and you CAN speed things up. That's all I can tell on this matter. Kind Regards.

 

spacer.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...