News:

Looking for documentation? Take a look on our wiki

Main Menu

Can't add new media - bug with PHP 7

Started by biltong, April 18, 2016, 17:59:36 PM

Previous topic - Next topic

biltong

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

escapezone

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

Studio 42

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.

biltong

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

Milbo

We "fixed" it already. So long, just disable the error reporting and anything works again.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

biltong

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?

GJC Web Design

Why aren't u on 3.0.16 which is for J3.5.1 ?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jenkinhill

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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

biltong

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.

biltong

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.

biltong

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.

  • Obviously it causes the problem I experienced above and there is no way to configure an alternative location for /tmp in VM
  • and setting a value for open_basedir above public_html means that the vmfiles directory must be moved from the 'default' suggestion below public_html

This post 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