Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2009, 06:45 PM
kira kira is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 160
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help me understand this php error (from vBlogetin)?

Hi guys. Like an idiot I'm using vBlogetin. This in itself is not idiocy -- or at least, it wouldn't have been a couple of years ago, when SirAdrian was in charge and the script was active. I've found it to be an excellent system, at least for my community's needs, and unlike vBlog and other products, it offers the ability for users to pick their own styles from pre-set options. I (and they) loved this.

But it's since been sold and the creators/maintainers/purchasers have gone AWOL.

Anyway, suddenly, although I've done nothing to my forum recently, my bloggers are having issues with changing styles. When they try, they receive this error:

Quote:
Warning: fopen(/home/episodic/public_html/forums/blogs/datastore/972/styleid.php) [function.fopen]: failed to open stream: Permission denied in /blogs/backend/functions_blog.php on line 522

Fatal error: Could not open /home/episodic/public_html/forums/blogs/datastore/972/styleid.php for reading in /blogs/backend/functions_blog.php on line 525
#0 vb_error_handler(256, Could not open /home/episodic/public_html/forums/blogs/datastore/972/styleid.php for reading, /home/episodic/public_html/forums/blogs/backend/functions_blog.php, 525, Array ([userid] => 972,[file] => styleid,[data] => 100,[path] => /home/episodic/public_html/forums/blogs/datastore/972/,[filename] => /home/episodic/public_html/forums/blogs/datastore/972/styleid.php,[fileHandle] => )) called at [(null):0] #1 trigger_error(Could not open /home/episodic/public_html/forums/blogs/datastore/972/styleid.php for reading, 256) called at [/home/episodic/public_html/forums/blogs/backend/functions_blog.php:525] #2 saveUserFileDatastore(972, styleid, 100) called at [/home/episodic/public_html/forums/blogs/manage.php:396]
I have no flippin' idea what all this means. (I have a rudimentary capability at best in php, I'm ashamed to admit.) Can someone point me in the right direction, maybe? Just in case it helps, here are lines 505 - 530 in functions_blog.php:

PHP Code:
function saveUserFileDatastore($userid, $file, $data)
{
    $path = BLOG_DATASTORE . "/$userid/";
    if (!is_dir($path))
    {
        $dirHandle = mkdir($path, 0777);
        
        // umask fix
        chmod($path, 0777);
        
        if (!$dirHandle)
        {
            trigger_error("Could not create directory $path", E_USER_ERROR);
        }
    }
    $filename = BLOG_DATASTORE . "/$userid/$file.php";
    
    $fileHandle = fopen($filename, 'w');
    if (!$fileHandle)
    {
        trigger_error("Could not open $filename for reading", E_USER_ERROR);
    }
    
    $newFile = '<?php if (!defined("BLOG_PATH")) { exit; } ';
    $newFile .= '
$data ' . arrayToString($data) . '?>';
The weird thing is:

- Unlike the others, I can change my style. This makes sense, since I'm admin. But I cannot change others' styles, as I get the above message.

- Even weirder, I created a test user account and gave it the same permissions as others who are having problems, and this test user can change his/her style!

- New Data Point: I just went into the test user's blog from my regular admin account, and tried to manage the settings, and was able to change the style. So since I couldn't change the blog styles of the other users, something is clearly different from this blog and those of the folks having issues. But they all have the same usergroups. I don't get it. I wish I were smarter. I really do love this blogging system and will hate to give it up for vb4. I should've given it up once the original creators weren't able to maintain it, but it's just so much more bloggy than vBlog that I decided to stick with it. Serves me right, I guess.

It doesn't appear to be browser-specific. Both IE7 and FF are represented amongst the people having issues, as are both Vista and XP.

Does anyone have any ideas what could be the problem? Very frustrating. Again, I haven't made any changes to the forum.
Reply With Quote
  #2  
Old 07-16-2009, 06:47 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can help you over IM if you'd like.
Reply With Quote
  #3  
Old 07-16-2009, 07:11 PM
kira kira is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 160
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OMG!!!

I would more than 'like', I would love that! I'll PM you. Thank you so much!

Edited to add: Rats, I guess I missed the opportunity. Anyone have any ideas in the meantime?
Reply With Quote
  #4  
Old 07-17-2009, 08:29 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Most likely a permission problem on the blogs/datastore directory or 1 of it's subdirectories. All diretories (and files) under teh datastore directory must be writable by the webserver process.
Reply With Quote
  #5  
Old 07-17-2009, 06:34 PM
kira kira is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 160
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Marco. Yes, I do believe you're right. Adrian was kind enough to IM with me a bit yesterday, and in doing so, helped me find some possible/likely issues.

I've seen this error crop up a few times while searching on Google (and oddly it's always related to vBlogetin!), but no one seems to have a solution. So I'll give plenty of details just in case this shows up in someone else's search. Here's what I've determined so far.

First, I kinda sorta forgot that a couple of months back, my site changed servers. Heh. Yes, I'm apparently scatterbrained enough to forget a site move. In my defense, it was my webhost's doing (I'm on a shared server, which my hosts switched so they could upgrade our php version) and everything went smooth as silk, so I didn't have to do anything. So it was easy to forget that anything moved at all.

ANYway, once I remembered this vital piece of info, Adrian suggested that the server change may have reset the permissions on the files. He told me to go to FTP and check the permissions and ownership of the blogs/datastore directory, just as Marco above mentioned. He also recommended that I sign up as a new account, get a blog, and change the style so that the script would create a new styleid.php file. (Each blog owner gets his/her own directory in that blogs/datastore folder, and within that directory is a file called "styleid.php" that tells the program which style to use for that blog.)

I signed up with the test account and got a new blog, changed the style, and again had no problems. So this new account was clearly different in some way from the older accounts that couldn't change their styles.

Next I went through FTP to view permissions on the files. The permissions on the styleid.php for everyone, even the new accounts, was all the same -- 644. My own styleid.php was set to 777. So it doesn't appear to be a CHMOD solution here.

Then, after I went in through putty to view the file ownerships in the datastore folder, I saw that the 'owner' of the styleid files belonging to older blog accounts -- those that are having trouble changing styles -- is "episodic", which is the name of my hosting account. But the 'owner' of the newer files for new blogs is "nobody." For some reason, "nobody" works, but "episodic" doesn't.

Welp, that's the status so far. I haven't a clue how to fix this issue or what to do next, but am waiting hopefully for Adrian to get back to me, if he has time available. Of course, if in the meantime anyone else has any suggestions, I'd be extremely grateful! Thanks.
Reply With Quote
  #6  
Old 07-20-2009, 10:57 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Simply reset the owner (nobody) and permissions (777) on all files and directories under ./datastore.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:20 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03705 seconds
  • Memory Usage 2,219KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete