Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 12:25 am EST

Geeklog Forums

Random Block


John Cutliffe

Anonymous
I have been fiddling with the random block code for a few days and as I am completely new to PHP am having trouble with it.
I have put the block-random.php file in my site base directory and tried it in the blog (geeklog) main directory. I also added the function to the lib_custom.php file and uploaded it. I got the folowing errors.

Warning: phpblock_galleryrandomphoto(): open_basedir restriction in effect. File(/gallery/init.php) is not within the allowed path(s): (/home/johnc:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/johnc/public_html/blog/system/lib-custom.php on line 152

Warning: phpblock_galleryrandomphoto(/gallery/init.php): failed to open stream: Operation not permitted in /home/johnc/public_html/blog/system/lib-custom.php on line 152

Fatal error: phpblock_galleryrandomphoto(): Failed opening required '/gallery/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/johnc/public_html/blog/system/lib-custom.php on line 152

Is this something simple or would I need to give you how I modified the code to get a beter answer?

Thanks for your help again

My geeklog is at http://www.jigtime.com/blog

 Quote

Status: offline

Turias

Forum User
Full Member
Registered: 10/20/03
Posts: 807
It looks like the code thinks your gallery path is in /gallery.

That would put it at the root of the filesytem. You should fix that.
 Quote

Status: offline

johnc

Forum User
Newbie
Registered: 01/22/04
Posts: 6
Thanks for the reply but I dont understand how to write the path. The gallery lives at

my site's public_html/gallery/

geek log lives at

mysite's public_html/blog

 Quote

Status: offline

Turias

Forum User
Full Member
Registered: 10/20/03
Posts: 807
/home/johnc/public_html/gallery/

That's the path to gallery... Smile
 Quote

Status: offline

johnc

Forum User
Newbie
Registered: 01/22/04
Posts: 6
Thanks for this help. I did try that path in the code for the function but still getting these errors
Warning: phpblock_galleryrandomphoto(/home/johnc/public_html/gallery/ init.php): failed to open stream: No such file or directory in /home/johnc/public_html/blog/system/lib-custom.php on line 82

Fatal error: phpblock_galleryrandomphoto(): Failed opening required '/home/johnc/public_html/gallery/ init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/johnc/public_html/blog/system/lib-custom.php on line 82

Sorry to be a pain.

I went out and bought MySQL and PhP for Dummies but it may take some time for me to get my head around it.

 Quote

Status: offline

Turias

Forum User
Full Member
Registered: 10/20/03
Posts: 807
Look at this:

'/home/johnc/public_html/gallery/ init.php'

There is a space before init.php. It still looks like your paths are incorrect.
 Quote

Status: offline

johnc

Forum User
Newbie
Registered: 01/22/04
Posts: 6
I dont know who you are but thank you so much. That worked fine. Stay safe and well

JohnC
http://www.jigtime.com
 Quote

Status: offline

johnc

Forum User
Newbie
Registered: 01/22/04
Posts: 6
Oops... I did it and it worked as in it is pulling files from my Gallery but at the top of the page it is giving this warning
Warning: fopen(/home/johnc/public_html/gallery/block-random.cache): failed to open stream: Permission denied in /home/johnc/public_html/gallery/platform/fs_unix.php on line 55

Thanks again.. your favorite Irish pain in the .......
 Quote

Status: offline

geKow

Forum User
Full Member
Registered: 01/12/03
Posts: 445
try setting the file attributes of your temp/block-random.cache file to 777

geKow
 Quote

Status: offline

johnc

Forum User
Newbie
Registered: 01/22/04
Posts: 6
Thanks to everyone for thier help
John
 Quote

All times are EST. The time is now 12:25 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content