ComicCMS Forums
NEW VERSION RELEASED!

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

2486 Posts in 607 Topics- by 19859 Members

September 08, 2010, 03:15 AM




ComicCMSComicCMSHelp & SupportInstall HelpError Folder creation failed - lib/site/
Pages: 1 [2] 3
Print
Author Topic: Error Folder creation failed - lib/site/  (Read 2328 times)
SteveH
Administrator
Hero Member
*****
Posts: 763



View Profile
« Reply #15 on: February 08, 2010, 05:57 PM »

No, the downloader doesn't mess with umasks, that's way too dangerous in the way that was describing (locking out files). As long as you actually can delete all the folders the installation has made you should be fine.

It is understandable that something could go wrong using PHP to create a folder in a folder owned by your FTP user, but that isn't the problem here, that works fine. The problem is PHP creating a folder in a folder PHP created, it makes no sense to me as the permissions must be full and the user ids (umask) must be the same. This just seems a bit off to me...

I don't know if they'll be more helpful to a support request from a customer, but this is the information I gave them:
Quote
The specific problem is, I think, that PHP can create a folder but cannot create a sub-folder inside of it (perhaps not able to write to it at all?). The code in question is along the lines of:

Code:
foreach ($folders as $folder) { // The folders are called in good order (e.g. dir/ before dir/sub/ )
    @mkdir($folder);
    if (!is_dir($folder)) {
        @chmod(parentdir($folder),0777);
        @mkdir($folder);
        if (!is_dir($folder)) $this->enderr('Folder creation failed - ' . $folder); // This is where it is failing (only on subdirs)
    }
}
Logged

Sign up to Comic Rank and get to know the number of readers of your webcomic!
tensimon
Full Member
***
Posts: 80



View Profile WWW
« Reply #16 on: February 09, 2010, 12:59 AM »

yeah, that doesnt make much sense to me either (not that I know much, but I can certainly follow your logic).

No recent replies to my forum post, tho' i'll give it another half-day or so before i submit a support ticket. I'll let you know how it goes.

EDIT:
I'm in!

Here's the relevant bit from the nfs forum post that got me in:

Quote
Before you run the download.php script,

chgrp web download.php

Make sure your comic directory (where download.php resides) is writeable - probably best to chgrp web that, too.

EDIT: I have succeeded in installing ComicCMS and uploaded a couple of images, but that is only the start of the problems. Database errors and 500 internal server errors make it pretty much unusable.

You might have more success if you change your server type to "Flex". Safe-mode really messes up ComicCMS.

So I changed my server type and it installed without a hitch.

Not sure what you'll make of the incompatibility between php safe mode and comiccms, I asked for more details to pass along to you, so if I get any, I'll pass them along.

EDIT:
Now, you've probably realised that there's going to be a long stream of questions from me as I set up my site (and believe me, I am REALLY kicking myself for not realising there was a transliteration problem with my site name about three years ago).

But since I already created a comicCMS site, if there's a quick way to turn the new installation into something that functions like the old one, best you tell me and safe us both a lot of confusion. I initially wondered if I could move the old one across somehow then upgrade, but all sorts of files would say tensi not tensai, so that would never work. Then I thought about installing comicCMS 0.1.7b (the one I have on tensi) on tensai site THEN upgrading, until I realised the downloader downloads the new version so the old version will no longer be available at that download location.

(or is there a separate download still available? And how reliable is the upgrade process?Huh)

Any suggestions? I promise I'll buy you a beer (I'll find a way!) if there is a relatively painless way to do this. The main problem is I created several static pages that are supposed to explain and promote the free download teaching book that will be available from the new site. (CSS and the overall look of the site I can tinker with later on)

By the way, this links to the comic I'm drawing because that teaching book involves teachers photocopying handouts that have my website address in the corner, and handing them out in classrooms.....all over japan. talk about free publicity.

anyway it's late and I'm rambling, at least we got comiccms to install.
« Last Edit: February 09, 2010, 06:18 AM by tensimon » Logged

www.tensaimon.com - a comic about an English teacher in a Japanese school. In Japanese and English, with English and Japanese subtitles
melonator
New
*
Posts: 8


View Profile
« Reply #17 on: February 09, 2010, 07:13 AM »

So how do I change the server type in NFS? I don't see flex or safemode in the server options...:/


EDIT1
 Also to help you with your query, why not redirect your old site to your new? And then edit each old comic and re upload to the new site? Or Link your old site for early content like comic 1-100 will redirect to the old site and 101 -500 which is new will be off of the new site.
« Last Edit: February 09, 2010, 09:41 AM by melonator » Logged
SteveH
Administrator
Hero Member
*****
Posts: 763



View Profile
« Reply #18 on: February 09, 2010, 02:36 PM »

The owners of NFS have got in touch with me again, they're going to write up a report on their permissions handling and hook me up with some webhosting to try and sort this stuff out. I'll keep you updated.

In terms of porting your current site the best move would be to move ComicCMS as it is now to your new site (all tensimon links will be converted if you do it properly) then upgrade from that. Hopefully if you are in flex mode this will not create more permissions errors. To move it across delete everything from storage/cache/ and copy all the files across. Then open up lib/lib.php and change the values on the first line to reflect the new URL & path. Browse around your site a bit, do some tiny changes to a comic to check it all writes fine, then upload the new download.php file to your site and the upgrade should go fine.
Logged

Sign up to Comic Rank and get to know the number of readers of your webcomic!
tensimon
Full Member
***
Posts: 80



View Profile WWW
« Reply #19 on: February 09, 2010, 03:19 PM »

melanator - you on nfs too huh? that explains why we are having the same problem

to change your server type, click 'sites', then click your site's short name, then on the right under 'actions' the third link is 'change server type', click that then select 'flex' (the first on the list).

However, I got these two messages on the nfs support forum:

Quote
Actually, I feel a bit bad about recommending flex before exhausting all the other options. I bet it's possible to get ComicCMS to work in php safe mode with a bit more work.

Quote
The issues with creating files and directories in safe_mode aren't specific to us, they apply to any host that uses it.

The ComicCMS developer has kindly reached out to us about this issue and we're going to see if there's anything we can do to work with him to get people some straight answers as far as what exactly needs to be done to get happy results.

(you can see the whole discussion for yourself on the nfs forum, search for posts under my username 'slartibartfast')

So flex is probably a good temporary way to go while steveH and nfs sort out the problems. Hope it doesn't get too complicated steve, thanks for all the work.

I'll leave it in flex mode for now, I'm going to try moving my site (kicks self again for not realising sooner....)

laters

EDIT: perhaps unsurprisingly, I am running into permissions errors - I can't download some files from tensi (sorry, i neglected to write down which ones) and I couldn't delete some files from tensai (public/storage/tmp/chron/alarm,  and some others in a similar location), and so, um, I can't remove all of the tensai installation I installed yesterday, and I can't download all the files from tensi in order to upload them to tensai.

tried deleting 'public' in tensai with the same effect. it's the second-level files and folders that are the problem, I can delete the first level. apparently trying to overwrite them with the files from tensi doesn't work either. (I uninstalled within comicCMS admin panel first).

this is presumably all about permissions again (even tho' both sites were set to flex now), I guess you'll know more about that later on. Just keeping you up to date...

oh and for good measure tensi no longer works, I get a 500 error saying "File specified not found (/f1/content/tensimon/public/lib/db/settings.php)", however I can ftp and see that lib/db/settings.php is still there, and I don't think I deleted anything from tensi anyway, just downloaded. But let's not worry about that for now, tensai is the one i want.
« Last Edit: February 09, 2010, 05:14 PM by tensimon » Logged

www.tensaimon.com - a comic about an English teacher in a Japanese school. In Japanese and English, with English and Japanese subtitles
melonator
New
*
Posts: 8


View Profile
« Reply #20 on: February 09, 2010, 07:15 PM »

thanks, and yeah I was reading that thread a few hours ago.
Logged
tensimon
Full Member
***
Posts: 80



View Profile WWW
« Reply #21 on: February 15, 2010, 05:25 PM »

any news steve?

No hurries, just wondering if there's been any progress.
Logged

www.tensaimon.com - a comic about an English teacher in a Japanese school. In Japanese and English, with English and Japanese subtitles
SteveH
Administrator
Hero Member
*****
Posts: 763



View Profile
« Reply #22 on: February 16, 2010, 06:31 AM »

I've pretty much hit a dead end here, I can get it to work but it does require a workaround. For NFS ComicCMS works fine either in flex mode or if you run a specific command before installing.

The problem:
A folder is meant to take on the group ID of the thing that created it (say, FTP or PHP) but the new NFS filesystem instead uses the group ID of the parent folder, this means the created folder may not be editable by the thing that creates it. The only way to fix this is to make sure the folder and the php script use the same group ID. Luckily you can do this on NFS but not through PHP, only through SSH.

The fix:
Either run your server in flex mode or SSH to your machine and run this code in your ComicCMS directory:
Code:
chgrp web ./ ./download.php
Then everything will work normally.

To SSH to your server from linux and probably mac you start a command prompt and use the ssh command. From windows it is a bit more tricky, I think downloading PUTTY is what most do. If you use the details given to you in the NFS panel for SSH connections you should connect fine and, hopefully, you will start up in the base directory of your site. Make sure you've uploaded download.php and then type in ls and hit enter, it should say that download.php is in that folder. Then type in the above command and everything should be peachy from then on.

If you need more help on using SSH with Windows you should probably talk to NFS as I have no experience with it.


To copy your current file across, perhaps it would help if you changed your old server to flex mode first?
Logged

Sign up to Comic Rank and get to know the number of readers of your webcomic!
tensimon
Full Member
***
Posts: 80



View Profile WWW
« Reply #23 on: February 16, 2010, 03:43 PM »

thanks steve, no time right now but I'll have a go at that later on (today?) and report back.
Logged

www.tensaimon.com - a comic about an English teacher in a Japanese school. In Japanese and English, with English and Japanese subtitles
tensimon
Full Member
***
Posts: 80



View Profile WWW
« Reply #24 on: February 18, 2010, 04:24 PM »

no surprizes here, but that didnt work, attached is a screenshot of the error message I got after doing this:

1) logging on to nfs via putty
2) inputing my user name and password
3) typing 'ls' (that's a lowercase 'L' yeah?)
4) getting a short list of the contents of my public directory
5) entering the chgrp code above by cut and paste, then hitting enter
6) nothing happened, i just got another terminal prompt, so I closed putty and
7) navigating to download.php
8) I then got the attached error message at the first hurdle

(i tried viewing the error log under 'advanced' but nothing came up, it just said 'waiting for user....' forever)

I may have to send nfs a support ticket and beg them to sort it out, but before that I thought I'd ask you. and/or start to consider switching hosts.....

(I've also posted this in the nfs memmbers forum)

oh, and bits of the prev installation are still left over in tensai, can't delete them to start afresh because of the usual permissions issues.....could that be causing a problem??

EDIT: tried it in flex, attached is the (different) error message, I ftp'd and lib/db/settings.php isnt there - but shouldnt the downloader be downloading it?? again is this because of the old files? but how on earth to delete them (refused permission every time i try).

So I tried doing the SSH thing again (repeat steps 1-8 above) (thought I'd try it again now I am in flex mode) and got exactly the same result (errormessage02.png). (strangely this is the same problem - lib/db/settings.php that is occuring over at tensi, where theoretically at least i havent changed anything (just downloaded)).

I have no more ideas what to try. I do however have a headache. Maybe I should spend the rest of the morning drawing something.....



* errormessage.png (26.32 KB, 718x452 - viewed 71 times.)

* errormessage02.png (20.86 KB, 692x358 - viewed 68 times.)
« Last Edit: February 18, 2010, 06:00 PM by tensimon » Logged

www.tensaimon.com - a comic about an English teacher in a Japanese school. In Japanese and English, with English and Japanese subtitles
SteveH
Administrator
Hero Member
*****
Posts: 763



View Profile
« Reply #25 on: February 18, 2010, 05:14 PM »

These errors are because you are trying to update an older version of ComicCMS, did you forget to change the path in lib/lib.php ? If you are having problems with it then just change it to './'

You did the SSH things fine, but for updating an old version you may need to go the extra step of using this command too:
chgrp -R web ./
« Last Edit: February 19, 2010, 05:20 AM by SteveH » Logged

Sign up to Comic Rank and get to know the number of readers of your webcomic!
tensimon
Full Member
***
Posts: 80



View Profile WWW
« Reply #26 on: February 18, 2010, 06:43 PM »

thanks, I've just done that, tho someone on the nfs board also pointed out this:

Quote
You're trying to load /f1/content/tensaimon/... when your site is in /f5/tensaimon/...
and pointing me to this in the FAQ:

Quote
What is the path to the root of my site in PHP?

The exact path can vary based on when your site was created and when it was last reconfigured. To make sure you stay pointed at the right location, use the PHP-standard $_SERVER['DOCUMENT_ROOT'] value to refer to your site's public directory.

We also provide the $_SERVER['NFSN_SITE_ROOT'] variable for this purpose, in addition to DOCUMENT_ROOT. NFSN_SITE_ROOT points to your site's root directory, the parent of public and protected, making it the best choice for safely referring to the protected directory from PHP.

The path to your site will also differ between PHP 5 Fast (where it can vary) and PHP 5 Flex (where it will always work like CGI).

We strongly recommend that you use $_SERVER['DOCUMENT_ROOT'] or $_SERVER['NFSN_SITE_ROOT'] whenever possible and avoid hardcoding paths in order to avoid problems in the event of a change.

I've replied asking for some info on what I need to do about that (and apologising for being dim....)

Regarding the process of updating an older version, that'd be nice but at this point I will cheerfully accept starting from scratch so long as comiccms installs and works. I have a bad habit (it would seem) of putting the cart before the horse, so I figure this time around I'll set my update schedule, stick to it, and tweak the website once I am up and running.

haha, another update when I get a reply back on the nfs board, in the meantime back to drawing (which cured my headache by the way....)

EDIT: I got this reply on the nfs board:
Quote
Find the place in your config where you said /f1/content/tensaimon/ and fix it. You ought to be using $_SERVER['DOCUMENT_ROOT'] or $_SERVER['NFSN_SITE_ROOT'] (as explained in that FAQ), but if you have to hard code it, you can get the value of Apache Site Root on your site's Information page.

however, I didnt ever set the /f1/...etc, I presume the downloader did, any idea how to set this right?

Brianwave: is this because of the copied-from-tensi files? in which case I just need to find where (which .php file) its saying /f1/... and change this to /f5/...., is this right? (or even close?) I guess you'll know which file it is.

gotta go to work now, I'll check this forum again this evening
« Last Edit: February 18, 2010, 07:27 PM by tensimon » Logged

www.tensaimon.com - a comic about an English teacher in a Japanese school. In Japanese and English, with English and Japanese subtitles
SteveH
Administrator
Hero Member
*****
Posts: 763



View Profile
« Reply #27 on: February 19, 2010, 02:55 AM »

If you are happy starting from scratch then just delete everything in your tensaimon public folder and start again.

If you want to continue and update from your old version then you need to go to lib/lib.php and edit the path in there. Just set it as ./ for now and the updater will fix it good and proper.
Logged

Sign up to Comic Rank and get to know the number of readers of your webcomic!
tensimon
Full Member
***
Posts: 80



View Profile WWW
« Reply #28 on: February 19, 2010, 05:14 AM »

It is tempting to start from scratch, I thought about it, and actually downloaded the /public/ folder in it's entirety so I could upload it again if necessary, but thought I'd give moving it over another stab. It subsequently occurred to me that last time I tried to DOWNLOAD I ran into permissions errors - but this time I didnt. SSH seems to have worked.

Anyway, I've edited the paths in lib/lib.php to give the f5/....tensaimon.... path, uploaded, now I'm getting this (see attached).

I ftp'd looking for lib/db/settings.php and sure enough it wasnt there.

But there IS a lib/db/file/setting.php  (setting is singular in this one, no final 's'). Is that the same thing in a different place (i.e. in some file the path and name are slightly not-aligned with what I actually have installed on tensaimon). Or is it something completely different? it seemed significant that there is nothing else at all in lib/db except the /file/ that contains setting.php (without and 's'). I was tempted to start messing with that but then realised 1) i was shooting in the dark; and 2) that the issue is some other file looking in the wrong place even if this is the problem.

Here's a thought: is it possible that I failed to download all the files from tensi because of permissions errors, then uploaded what I had downloaded (which I think i remember doing, tho' events are hazy), so I am ending up with some old-cms files and some new-cms files, and they (unsurprisingly) don't all match up which is causing the current problems?

If this IS the case, then that, and the fact that tensi no longer works (so I can't go back and copy it again - not meaningfully anyway), means I've inadvertently lost tensi and must therefore start from scratch with tensai. I have nothing more to lose (having lost everything already) by deleting the contents of tensai and starting again.

Honestly, if there's a way to rescue the contents of tensi and make them into tensai then I'd like to do it (could save me some recreating time, tho I'll make the next version with less static pages), but if there isnt, well, so be it.

looking on the bright side: realistically we MUST be getting close here.   Roll Eyes

sleepy now, bedtime....


* errormessage03.png (20.57 KB, 690x330 - viewed 61 times.)
« Last Edit: February 19, 2010, 05:44 AM by tensimon » Logged

www.tensaimon.com - a comic about an English teacher in a Japanese school. In Japanese and English, with English and Japanese subtitles
SteveH
Administrator
Hero Member
*****
Posts: 763



View Profile
« Reply #29 on: February 19, 2010, 06:46 AM »

You're missing the settings file from your other site (an error while copying over). You may be able to SSH to your old site and run:
chgrp -R web ./
and then
chmod -R 0777 ./

The files you are probably missing are all in storage/private/ , so FTP to your old site, see if you can download those files, then upload them to your new site. You'll then need to run this command again on your new site:
chgrp -R web ./
Logged

Sign up to Comic Rank and get to know the number of readers of your webcomic!
Pages: 1 [2] 3
Print
Jump to:  

ComicCMS, free php webcomic management software Copyright © 2007 Steve H