Keyword
Please note that official support for commercial extensions & templates is provided in the Subscriber Help Desk.
Support requests should ONLY be directed there and require an active subscription plan.
This forum board is to be used for archive purposes and knowledge exchange ONLY.

PHP errors

  • Benjamin Aharonov
  • Benjamin Aharonov's Avatar Topic Author
  • Offline
  • New Member
More
17 years 7 months ago #3417 by Benjamin Aharonov
PHP errors was created by Benjamin Aharonov
Please help I get this error since installing the script on every page on my site:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/cache/imagenes10d233bad6453f71c651ef12637a2b9cjpg) is not within the allowed path(s): (/home/tchncnwe:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/tchncnwe/public_html/mambots/content/plugin_jw_sigpro.php on line 285

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/cache/imagenesd81fe0473327ce3921439f1a00058743jpg) is not within the allowed path(s): (/home/tchncnwe:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/tchncnwe/public_html/mambots/content/plugin_jw_sigpro.php on line 285

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/cache/imagenes0f1d0d2a902b171860023ef9c02b5a99jpg) is not within the allowed path(s): (/home/tchncnwe:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/tchncnwe/public_html/mambots/content/plugin_jw_sigpro.php on line 285

My url is: www.techno.com.mx

Thanks

Please Log in or Create an account to join the conversation.

  • Benjamin Aharonov
  • Benjamin Aharonov's Avatar Topic Author
  • Offline
  • New Member
More
17 years 7 months ago #3418 by Benjamin Aharonov
Replied by Benjamin Aharonov on topic Re: PHP errors
Resolved it removing the domain from cpanel whm tweak security open base dir protection.

Thanks anyway

Please Log in or Create an account to join the conversation.

More
17 years 7 months ago #3419 by JoomlaWorks
Replied by JoomlaWorks on topic Re: PHP errors
Will add a nice "@" sign before the openbasedir function to "hide" this notice in the 1.3 release.  ;)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
17 years 6 months ago #3420 by mjarntz
Replied by mjarntz on topic Re: PHP errors
Can I change this in the current version (1.2) myself? Because rigth now I can not use this gallery.

Thanks,

Mark

Please Log in or Create an account to join the conversation.

More
17 years 6 months ago #3421 by JoomlaWorks
Replied by JoomlaWorks on topic Re: PHP errors
Open up the file mambots/content/plugin_jw_sigpro.php.

In line 87, change this:
if ($dh = opendir($mosConfig_absolute_path.$rootfolder.$_images_dir_)) {

to this
if ($dh = @opendir($mosConfig_absolute_path.$rootfolder.$_images_dir_)) {

;)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
17 years 6 months ago #3422 by mjarntz
Replied by mjarntz on topic Re: PHP errors
Sorry, that didn't solve the problem. Still I get the errors.

Thanks,

Mark

Please Log in or Create an account to join the conversation.

More
17 years 6 months ago #3423 by JoomlaWorks
Replied by JoomlaWorks on topic Re: PHP errors
Try this in the backend:
Site >> Global Configuration >> (tab) Server >> Error Reporting:
select "System Default" or "none".

That should fix these warnings. And check with your host too on that.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
17 years 6 months ago #3424 by mjarntz
Replied by mjarntz on topic Re: PHP errors
That did the trick! Yes I have contacted my host on this. They told me that the error was the result of trying to write / read from locations that are not allowed.

Thanks,

Mark

Please Log in or Create an account to join the conversation.

More
17 years 6 months ago #3425 by JoomlaWorks
Replied by JoomlaWorks on topic Re: PHP errors
Damn hosting restrictions!  ;D

Anyway, we hope to address that in 1.3, by making the code more flexible to work on such environments.  ;)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
16 years 4 months ago #3426 by jhooks
Replied by jhooks on topic Re: PHP errors

Damn hosting restrictions!  ;D

Anyway, we hope to address that in 1.3, by making the code more flexible to work on such environments.  ;)


Just thought I would let you know I had the same problem as the OP turned out the problem was due to a bug in sig_pro.  The only effect of having open_basedir enabled is that it showed the bug for what it was.

The diff is as follows:
s15291501:/srv/www/vhosts/staging.scrine.org/httpdocs/mambots/content # diff plugin_jw_sigpro.php plugin_jw_sigpro.php.orig
285,286c285,286
<   if (file_exists($mosConfig_absolute_path.$tempfolder.md5($_images_dir_.$name).".".$format) && filemtime ($mosConfig_absolute_path.$tempfolder.md5($_images_dir_.$name).".".$format) + $cache_expire_time * 60 > time()) {
<   $html .= $leftcomment.'<img alt="'.$clickopen.'" title="'.$clickopen.'" src="'.$tempfolder.md5($_images_dir_.$name).".".$format.'" />'.$rightcomment;
---
>   if (file_exists($tempfolder.md5($_images_dir_.$name).$format) && filemtime ($tempfolder.md5($_images_dir_.$name).$format) + $cache_expire_time * 60 > time()) {
>   $html .= $leftcomment.'<img alt="'.$clickopen.'" title="'.$clickopen.'" src="'.$tempfolder.md5($_images_dir_.$name).$format.'" />'.$rightcomment;

As you can see the original file misses out '$mosConfig_absolute_path' this causes it to generate the wrong path which is why it is (otherwise) inexplicably outside of the allowable open_basedir directories.  You will also notice that it was missing a "." before the $format.  Either of these bugs will prevent the thumbnail check from working and cause the thumbnail to be generated every time.

I know you were joking but I have to say it: Neither open_basedir, nor error reporting are 'damn hosting restrictions'.  Open_basedir is very useful, primarily as a security measure - even in a non-shared environment you would never want your web server to have access out of the document root, some temp folder and maybe a libs folder.  Open_basedir also has the benefit of picking up some bugs that might not be spotted otherwise :P.  Error reporting is clearly beneficial for obvious reasons, though you probably wouldn't want it on a production server.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum