Skip Navigation

[Resolved] Getting a php warning calling types_render_field

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by simon 3 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#1595909

I'm reading some types image fields in php using:

types_render_field($field_key,$options)

with an options array such as :

(
[id] => 15667
[size] => medium
[output] => normal
[url] => true
[resize] => proportional
)

I'm seeing the following PHP warning:

PHP Warning: is_writable(): open_basedir restriction in effect. File(/www/hundeurlaubnet_143/) is not within the allowed path(s): (/www/hundeurlaubnet_143/public:/www/hundeurlaubnet_143/mysqleditor:/www/hundeurlaubnet_143/web:/www/hundeurlaubnet_143/deploy:/www/hundeurlaubnet_143/deployment:/www/hundeurlaubnet_143/deployments:/usr/share:/tmp) in /www/hundeurlaubnet_143/public/wp-content/plugins/types/vendor/toolset/types/embedded/views/image.php on line 395

It seems to occur when no image is present - and it does not occur on all posts. It applies to multiple posts and multiple image fields. I don't see any consistency to it. The path being returned is the root directly on my host. Where images exist, I don't get a warning and the image is displayed as expected.

It's not really causing me any issues, but it's been there for a few versions. I've just upgraded to the latest versions of Toolset and I'm seeing the same error.

#1596755

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Simon,

Thank you for contacting us and I'd be happy to assist.

A warning like this can be shown if the tmp directory or folder on the server is either not configured properly or is not accessible.
( ref: hidden link )

Also, please check that if this website was migrated from a different location, then there should be no reference to the old directory or paths in any files or in the database.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1690259

Hi Waquar - I'm still suffering this issue. I've added further logging and the field in question is an empty image field. Checking in phpmyadmin, there is a post_meta entry for the field, but it has an empty value. I've checked a couple more Types image fields on the same post, and they look identical - i.e. the field exists in post_meta, but has no value. Looking at the plugin code, the public static function getWritablePath - I'm seeing the following values:

$img - /www/****net_143/public//
$dir - /www/****net_143/

The other 'empty' images do not call the getWritablePath function.

The site has been hosted at kinsta for the last 5 years or more - it's only a very small percentage of images that seem to have the problem.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.