Avatar of APD Toronto
APD TorontoFlag for Canada

asked on 

Catch Metaslider Error

Hi Experts,

If you go to www.m-p-c.org you will see a Meta Slider error on top.

I posted a question related to this at https://www.experts-exchange.com/questions/29206863/Meta-Slider-Error-Auto-Updates.html - and the only solution we cam up then was do use the older plugin version which I used when building the site - now that doesn't work too.

I just checked, there is no such directory that is being suggested :

As everything works, and as this is a custom theme from scratch, with its own header.php and functions.php files. That said, how can I catch and ignore this specific error ? Maybe, when I'm calling the metaslider shortcode?

Any help would be appreciated .
PHPWordPress

Avatar of undefined
Last Comment
APD Toronto
Avatar of Bembi
Bembi
Flag of Germany image

What I would expect first is - you see it on the website - , why the slashes are mixes, forward slashes and back slashes.
While windows uses backslashes, web applications usually using forward slashes.
Another point is - as a webdirectory is relativ to its root - , why you see the physical directory. C:\Inetpub\...
So the root path play a role only for the windows part (here IIS), but the php file doesn't really see it.
You may check, if there is an error in the php.ini file or inside a php config file for your application. 




Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

This is what I get at the top of the page:
Warning:  is_readable(): open_basedir restriction in effect. File(C:\Inetpub\vhosts\m-p-c.org\httpdocs/wp-content/plugins/C:\Inetpub\vhosts\m-p-c.org\httpdocs\wp-content\plugins\ml-slider-000/metagallery/languages/metagallery-mk_MK.mo) is not within the allowed path(s): (C:/Inetpub/vhosts/m-p-c.org\;C:\Windows\Temp\) in C:\Inetpub\vhosts\m-p-c.org\httpdocs\wp-includes\l10n.php on line 741 
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Take a look at this article
https://xneelo.co.za/help-centre/website/open_basedir-error/
From the link above

In most cases, this error occurs when your site has been transferred from a previous host that uses Cpanel, and the relevant file paths have not been updated to reflect the correct file path on our servers.
All website content needs to be placed in the public_html folder within the home directory, rather than directly into the home directory.
What this is saying is you are trying to open a path you do not have access to.
Avatar of APD Toronto
APD Toronto
Flag of Canada image

ASKER

Hmmm... I did transfer this site from my dev to my live, which have different paths.

When I did transfer, I did have a similar issue with get_template_directory_uri();, which I fixed by adjusting the entries in a db table, but now I cannot remember which?

Is there a similar fix I can do with the mt-slider? If I un-install it, then re-install it, will the slides and settings be go\ne.
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

There is something screwy with your paths. The error is saying this path
C:\Inetpub\vhosts\m-p-c.org\httpdocs/wp-content/plugins/C:\Inetpub\vhosts\m-p-c.org\httpdocs\wp-content\plugins\ml-slider-000/metagallery/languages/metagallery-mk_MK.mo

Is not within the allowed paths
C:/Inetpub/vhosts/m-p-c.org\;C:\Windows\Temp\

The first path has :C:\inetpub in it twice - you need to look at where it is getting that from.

When you migrated the db did you use the WP CLI to update the paths in the DB? If so you might need to run it again to find all instances of the path listed (first) above and change it to the valid equivalent.
Avatar of APD Toronto
APD Toronto
Flag of Canada image

ASKER

I usually do it manually. The dev URL was http://192.168.2.200/www.m-p-c.org/ but when exporting the .sql file I replaced all http://192.168.2.200/www.m-p-c.org/  with https://www.m-p-c.org/ . This is my usual procedure which always works.

SOLUTION
Avatar of Bembi
Bembi
Flag of Germany image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of APD Toronto
APD Toronto
Flag of Canada image

ASKER

I fixed the open_basedir directive, but makes no difference.

Even when I manually navigate, theres no directory.

Can I try { shortcode} catch-ignore this error ?
Avatar of Bembi
Bembi
Flag of Germany image

On the public site I still see it, so have you restartet the webservice (windows: iisreset)

The directrive is for limiting php only to these directories. This is what even the error tells you. 
For testing, you can leave it empty.
For a public service, it depends how the solution is constructed.  
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

That looks mostly like my PHP/IIS except I don't think that PHP or IIS have access to C:\Windows\Temp .  ??  My session_save_path is C:\php\save .  I'm not running Plesk, just PHP 7.4.7 on IIS 7.5 .
Avatar of APD Toronto
APD Toronto
Flag of Canada image

ASKER

I'm really not sure how this relates to the mt-slider?

At any rate, how can I... try { shortcode} catch-and-ignore this error ? 
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

I still see the same error on your site.

Warning:  is_readable(): open_basedir restriction in effect. File(C:\Inetpub\vhosts\m-p-c.org\httpdocs/wp-content/plugins/C:\Inetpub\vhosts\m-p-c.org\httpdocs\wp-content\plugins\ml-slider-000/metagallery/languages/metagallery-mk_MK.mo) is not within the allowed path(s): (C:\Inetpub\vhosts\m-p-c.org\;C:\Windows\Temp\) in C:\Inetpub\vhosts\m-p-c.org\httpdocs\wp-includes\l10n.php on line 741 

Somewhere you have an extra C:\Inetpub\ in there that is killing the allowed path statement.
Avatar of Bembi
Bembi
Flag of Germany image

Hi,
PHP has access on any location on a local machine which is available by the security context of the php process.
That doesn't mean, that the user has access.
This directrive is to limit this down. You can do this in the same way by setting permissions in the right way or just to limit the available pathes down to the list, which is provided via php.ini.
In reality, the OS is usually limited down anyway, so that IIS processes can not see other parts of the server, but you can change this, even accidentially.

But if you set this directrive, it hat so be set in the right format.
To disble it, just comment it out...
;open_basedir =

to enable it, it should look like (inside PHP.ini)
open_basedir = "C:\Inetpub\vhosts\m-p-c.org\;C:\Windows\Temp\"

As this directrive had also some bugs in the past, you may try even without backslashes...
open_basedir = "C:\Inetpub\vhosts\m-p-c.org;C:\Windows\Temp"
 
Also your php as it is no the newest one...

At least it looks like that
C:\Inetpub\vhosts\m-p-c.org\httpdocs\wp-includes\l10n.php
is the source of the message.

As I assume that it is Wordpress (is it ?), you may also take into account, that you can also set directrives by the https.conf file inside the WordPress folder. So the php.ini defines the generic settings, while the httpd.conf may define application specific settings and even wordpress can overwrite them..
Just worth to look inside.

    
Avatar of Bembi
Bembi
Flag of Germany image

Just according to your question. According the slider.
If you add functionality to an existing php application, it is usually done by adding additional php files into your file structure. These php files may have their own functionality and therefore they may use functions, which you haven't triggered before or they have some additional configuration needs.  
ASKER CERTIFIED SOLUTION
Avatar of APD Toronto
APD Toronto
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
PHP
PHP

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

125K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo