VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: biltong on April 18, 2016, 17:59:36 PM

Title: Can't add new media - bug with PHP 7
Post by: biltong on April 18, 2016, 17:59:36 PM
I think this is an issue with the /tmp directory showing as unwriteable with PHP7 at the bottom of the media edit page.

With PHP5.6 it is showing as writeable.

Attached screenshot shows page after selecting an image to upload, clicked Upload radio button then Save button.

J 3.5.1
VM 3.0.14
PHP 7.0.4
Title: Re: Can't add new media - bug with PHP 7
Post by: escapezone on April 18, 2016, 23:00:57 PM
Are you sure that with PHP5.6 you can add images?

I had a similar problem and i tried Joomla 3.5.1 , Virtuemart 3.0.14,  PHP 7.04 and  Database Type Mysqli and everything solved... (As you understand the problem was when i had Mysql PDO i don't know why but that solved my problem)

The only problem that i had now is that when i am uploading an image i get the following error

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Img2Thumb has a deprecated constructor in /var/www/vhosts/mydomain.gr/mysite/5/administrator/components/com_virtuemart/helpers/img2thumb.php on line 20

Do you have this error too ?

Regards,
Pagona
Title: Re: Can't add new media - bug with PHP 7
Post by: Studio 42 on April 19, 2016, 03:32:59 AM
virtuemart queries is not Mysql PDO complient.
It's only some queries, i reported already it, but i had no answer it someone in team check for this.
Title: Re: Can't add new media - bug with PHP 7
Post by: biltong on April 19, 2016, 10:41:34 AM
Quote from: escapezone on April 18, 2016, 23:00:57 PM
Are you sure that with PHP5.6 you can add images?

Yes,  I can add images with php 5.6 - see attached screenshots confirming this.

I'm not getting this error:

QuoteDeprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Img2Thumb has a deprecated constructor in /var/www/vhosts/mydomain.gr/mysite/5/administrator/components/com_virtuemart/helpers/img2thumb.php on line 20
Title: Re: Can't add new media - bug with PHP 7
Post by: Milbo on April 19, 2016, 11:45:15 AM
We "fixed" it already. So long, just disable the error reporting and anything works again.
Title: Re: Can't add new media - bug with PHP 7
Post by: biltong on April 19, 2016, 12:18:57 PM
Quote from: Milbo on April 19, 2016, 11:45:15 AM
We "fixed" it already. So long, just disable the error reporting and anything works again.

I've changed Joomla Error Reporting to None and still get the same problem with PHP 7 using VM 3.0.14. Was this fixed in 3.0.16?
Title: Re: Can't add new media - bug with PHP 7
Post by: GJC Web Design on April 19, 2016, 12:37:27 PM
Why aren't u on 3.0.16 which is for J3.5.1 ?
Title: Re: Can't add new media - bug with PHP 7
Post by: jenkinhill on April 19, 2016, 12:39:50 PM
I believe 3.0.14 was not fully PHP7 or J3.5.1 compatible, as covered here many times.  VM3.0.16 is the one to use atm.
Title: Re: Can't add new media - bug with PHP 7
Post by: biltong on April 19, 2016, 14:58:33 PM
OK thanks for the heads-up, I'll upgrade to 3.0.16 to see if that resolves this issue.

jenkinhill, I hear what you say but I've been on this forum countless times in the past few weeks and not seen anything saying that 3.0.14 is not PHP7 compatible and that 3.0.16 specifically resolves issues with PHP7.

I think I'm like most forum visitors, wearing blinkers focused on my specific VM issues so don't have the wider vision of everything that you Heros see and help with, which I appreciate immensly!

Milbo, surely spending a little time on an informative Twitter message and maybe a News article announcing 3.0.16 with information on what it fixes, is a better use of time than answering queries like mine?

My comments are meant to be positive so please don't take offense.
Title: Re: Can't add new media - bug with PHP 7
Post by: biltong on April 19, 2016, 16:08:32 PM
So I've upgraded VM to 3.0.16 and using PHP 7 still had the same problem.

With Joomla Error Reporting set to Development, I have noticed this message on the Media Edit page:

"Warning: is_writable(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/home/xxxxxxx/public_html) in /home/xxxxxxx/public_html/administrator/components/com_virtuemart/helpers/mediahandler.php on line 375"

and this at the bottom of the page:

/tmp :: Unwriteable
/home/xxxxxx/public_html/images/stories/virtuemart/typeless/ :: Unwriteable
/home/xxxxxx/public_html/images/stories/virtuemart/typeless/resized/ :: Unwriteable


::)

I then noticed that my PHP 7 Settings has open_basedir set to /home/xxxxxxx/public_html and no value for PHP 5.6.

This was restricting VM access to /tmp which I assume VM uses as a temporary upload destination.

I was thinking that /tmp was relative to the website root, i.e. public_html/tmp

So, no problem with VM and PHP 7 in this case  :-[

Thanks for your help.
Title: Re: Can't add new media - bug with PHP 7 / open_basedir
Post by: biltong on April 19, 2016, 16:21:53 PM
It would be useful to know what the developers' view is on using open_basedir, which is suggested on the Joomla Security Checklist https://docs.joomla.org/Security_Checklist/Hosting_and_Server_Setup (https://docs.joomla.org/Security_Checklist/Hosting_and_Server_Setup).

This post http://stackoverflow.com/questions/13772065/how-to-setup-open-basedir-in-php-for-joomla (http://stackoverflow.com/questions/13772065/how-to-setup-open-basedir-in-php-for-joomla) suggests setting it to open_basedir = /home/users/you/public_html