MDN

Go Back   Mambo - Forums Closed for posting > Mambo 4.5.5 - Stable > General Questions

Reply
 
Thread Tools Search this Thread Display Modes
Old November 3rd, 2004, 06:17   #1
Synsongs
 
Join Date: Oct 2004
Posts: 4
Synsongs is on a distinguished road
Default Component Upload - Failed to create directory

Hi everyone,

it seems that some servers cannot cope with a trailing backslash inside the directory path, therefore making it impossible to upload any Mambo component (see: http://forum.mamboserver.com/showthread.php?t=19038).

Those servers simply report "Failed to create directory" and do also normally not allow manual (web-based) component installation either.

Trying to solve this problem for a customer who cannot change his provider but needs components, I found a quick & dirty solution which might be helpful until this issue can be fixed.

Directory creation happens through „component.class.php” in directory
/administrator/components/com_installer/component.

One possible solution is to disable directory creation completely. This can be done by modifying „component.class.php” as described:


In Mambo 4.5.1.a stable locate these lines:

if(!file_exists($this->elementDir()) && !mkdir($this->elementDir(),0777)) {
$this->setError( 1, 'Failed to create directory "' . $this->elementDir() . '"' );
return false;
}

if(!file_exists($this->componentAdminDir()) && !mkdir($this->componentAdminDir(),0777)) {
$this->setError( 1, 'Failed to create directory "' . $this->componentAdminDir() . '"' );
return false;
}


Delete them completely, resave the file and upload „component.class.php” back into /administrator/components/com_installer/component.

In order to install components, you must now do the following:

1. Unzip component locally in order to see the directory/subdirectory structure
2. create the directory structure in the respective /component folder on the server 1:1
3. then upload the component via Mambo component installer

Due to the removal of MKDIR command, no directories will be created or checked, simply the files are copied.

DISCLAIMER: Whenever you try this at home, be sure to have a backup first. I am not responsible for any damage that might occur. The workaround described has been used successfully here, but I recommend to safely check first! Also be aware that this is modifying the core code, which you might not want! However, it saved me and my project for now :-)

All the best,
Tom
Synsongs is offline   Reply With Quote
Old November 3rd, 2004, 06:23   #2
reikimaster
 
reikimaster's Avatar
 
Join Date: Mar 2004
Location: Niagara Falls, NY
Posts: 435
reikimaster is on a distinguished road
Default

If you're going to manually go in there and create the directory structure, you may as well just put the files up. I've done this where I manually upload all the files, strip the files section from the xml installer, then install the component (or module). Then you don't have to hack any core files and the component gets installed normally except for the file copy (and directory creation) part.
reikimaster is offline   Reply With Quote
Old November 11th, 2004, 15:40   #3
ankn99
 
Join Date: Nov 2004
Posts: 13
ankn99 is on a distinguished road
Default

Is there a way to do a systemcall in PHP like in c

for example system("mkdir XYZ");

if so, and PHP can't be told to do this stuff without the trailing slash, this could be a better workaround ???

Greetings from 1XXXX Berlin / Germany
ankn99 is offline   Reply With Quote
Old November 11th, 2004, 17:30   #4
ankn99
 
Join Date: Nov 2004
Posts: 13
ankn99 is on a distinguished road
Default

If found a work around, with out this manual installing stuff.

I already patched two file and it's working great at least forthe template stuff, the other mkdir Problems I'll look for a workaround too.

If somebody like to get those Files leave a not here ( STRATO-Users are welcome) !!!

CU
ankn99 is offline   Reply With Quote
Old November 12th, 2004, 11:21   #5
ankn99
 
Join Date: Nov 2004
Posts: 13
ankn99 is on a distinguished road
Lightbulb

Since I was asked from synsongs what Files needs to be patched, I think I put it on the List for everyone who has Problems with the mkdir()-Routines in the Installation-part of Mambo.

there are 3 Files I changed:

administrator/components/com_installer/template/template.class.php
administrator/components/com_installer/admin.installer.php
administrator/components/com_installer/component/component.class.php


To install everythng just put the Mambo-patch.zip into the HOME-Dir of your Mambo login to your Server and do from there a

tar -xzvf Mambo-patch.zip

(It's realy a tar.gz File but not allowed to upload)

that should do the Job. But don't point with Fingers at me, when you blowup every Server in your Town. IT's your respnsability to Check what you are doing.

Have Fun with it.

Greetings from 1XXXX Berlin / Germany

P.S.: I'll try to build a nicer work around, to check at what System it's running, since I don't know what it is doing under Linux or Windoof !!!

--------- EDIT ------------

for the download, please look a couple lines further down this thread (Nr. 8 ) !!

--------- EDIT END --------
ankn99 is offline   Reply With Quote
Old November 12th, 2004, 14:25   #6
ankn99
 
Join Date: Nov 2004
Posts: 13
ankn99 is on a distinguished road
Default

Hi,
its me again. I think every one is sleeping. What ever. If those Users who have the mkdir() Problem and the directory to create shows on the screen with a trailing slash, could do me a favor ??

Please download the attachment install it on your Server or Webspace and call it with your favorite Web-Browser and tell me write in this forum, what you see at the screen.

Thanks in Advanced

and

Greetings from 1XXXX Berlin / Germany
Attached Files
File Type: zip test.zip (260 Bytes, 398 views)
ankn99 is offline   Reply With Quote
Old November 12th, 2004, 14:41   #7
Synsongs
 
Join Date: Oct 2004
Posts: 4
Synsongs is on a distinguished road
Default

Hi akn99,

had to rename the file to .php4 since PHP5 is not yet available on VERIO servers. The output result was:

FreeBSD

Thanks!
Synsongs is offline   Reply With Quote
Old November 12th, 2004, 15:29   #8
ankn99
 
Join Date: Nov 2004
Posts: 13
ankn99 is on a distinguished road
Lightbulb

Hi, it's me again !!

Now I changed a few things, Now it's looking for SunOS or FreeBSD if this is a case, the trailing slashes are striped off.

IT's a much nicer way to do this stuff.

For other people here on the list. I included 2 extras, one .htaccess for those who don't know how to force your WEB-Server by a .php extension a PHP-Version YOU like to use. In my case php5. a shellscript, that looks for every directory underneath the current working directory und copy's th .htaccess from the current Dir to the des-Dir fond by the finde-Statement.

Have fun with it.

Greetings from the Dark Bäärlin

P.S.: The reason why I post this stuff is, I was looking how to work around the Problem I've at STRATO (Please don't flame now just because I'm using it), but couldn't find any solution. Anything I found where those fine answers like :

change your Provider
learn this language
Doit manualy (Bäää) etc.

and with those little tricks I can dance a few steps further Mambo. And I hope other people from the Strato community who are afraid asking anything just because of those nice Flames, can just silently download this stuff and get that thing going.

By the Way a tried every install Mod, MamBot,Com, Template and I screwd up my Mambo that much, I had to delete some stuff by Hand inside the Dirs and per PHPMyAdmin inside the Database !!

So enoug for tonight.
Attached Files
File Type: zip patch2.tgz.zip (5.2 KB, 1197 views)
ankn99 is offline   Reply With Quote
Old November 15th, 2004, 19:25   #9
shinji
 
Join Date: Nov 2004
Posts: 1
shinji is on a distinguished road
Default

I would like to give you a big THANK YOU for you patch. It worked flawlessly allowing me to finally install SimpleBoard on my mambo install.
shinji is offline   Reply With Quote
Old November 22nd, 2004, 10:54   #10
garimoz
 
Join Date: Nov 2004
Posts: 1
garimoz is on a distinguished road
Default big job congrats!!!!

After a week of frustation tryng to find the solution I just happens to look
here.... and it WORKED!!!!!

big Thanks to you

garimoz is offline   Reply With Quote
Old November 22nd, 2004, 11:25   #11
ankn99
 
Join Date: Nov 2004
Posts: 13
ankn99 is on a distinguished road
Unhappy

Hi,

13 Reviews for the Patch is not bad.

Are most of the Users here Beginners in PHP like me ??

Or does nobody like User who are still with STRATO etc. ?

But anyway, with this patch I installed

20 Components
66 Modules
38 Templates

What I like to know is, does anybody had the problem, that the Website didn't work one Day where it worked perfectly the day before ?!?!? ??:

I figured out, that my "Space-Provider" is using linked Directories and from time to Time the Directory you receive per MAMBO-CONFIGURATION is all of the sudden diffent.
I changed the Configfile with a little trick, where I first of try to figure out, where my htdocs(Document-ROOT)-Directory is an then callup a function to convert it to the real-dircetory.

Who like to use this, send a Post and I'll update the Patch ;-)

Greeting from 1XXXX Berlin - Germany
ankn99 is offline   Reply With Quote
Old November 23rd, 2004, 14:29   #12
tvdluer
 
Join Date: Nov 2004
Posts: 4
tvdluer is on a distinguished road
Default safe mode on, copying not allowed?

Quote:
Originally Posted by reikimaster
If you're going to manually go in there and create the directory structure, you may as well just put the files up. I've done this where I manually upload all the files, strip the files section from the xml installer, then install the component (or module). Then you don't have to hack any core files and the component gets installed normally except for the file copy (and directory creation) part.
I followed the discussion so far.

The server I am working on shows safemode OFF, but mkdir is not possible.

So I uploaded all the files to the dir they should be. However, even when I strip the <files> tag from the xml file, it gives me an error on the copying of that file to the component directory when trying to upload the module zip (only containing that one, stripped down, xml file).

All in all, the component does get added [finally!], but these errors... ?
tvdluer is offline   Reply With Quote
Old November 23rd, 2004, 15:41   #13
ankn99
 
Join Date: Nov 2004
Posts: 13
ankn99 is on a distinguished road
Default

Quote:
Originally Posted by tvdluer
I followed the discussion so far.

The server I am working on shows safemode OFF, but mkdir is not possible.

So I uploaded all the files to the dir they should be. However, even when I strip the <files> tag from the xml file, it gives me an error on the copying of that file to the component directory when trying to upload the module zip (only containing that one, stripped down, xml file).

All in all, the component does get added [finally!], but these errors... ?
Hi, did you try the patches I've uploaded ??

It seems you have one of those funny Systems, where at the and of a mkdir command-Option youre Server don't like slashes. Those Patches are not special for the safemode Problem and it should not solve this.

Greeting from 1XXXX Berlin - Germany
ankn99 is offline   Reply With Quote
Old November 23rd, 2004, 16:13   #14
tvdluer
 
Join Date: Nov 2004
Posts: 4
tvdluer is on a distinguished road
Default mkdir

Added your patches, safe mode being OFF, not ON, uploading a component still results in this error:

Warning: mkdir(/var/www/web261/html/mambots/editors/htmlarea2) [function.mkdir]: Permission denied in /var/www/web261/html/administrator/components/com_installer/admin.installer.php on line 191
tvdluer is offline   Reply With Quote
Old November 23rd, 2004, 16:18   #15
ankn99
 
Join Date: Nov 2004
Posts: 13
ankn99 is on a distinguished road
Default

Quote:
Originally Posted by tvdluer
Added your patches, safe mode being OFF, not ON, uploading a component still results in this error:

Warning: mkdir(/var/www/web261/html/mambots/editors/htmlarea2) [function.mkdir]: Permission denied in /var/www/web261/html/administrator/components/com_installer/admin.installer.php on line 191
Try to vi a File under homedir called test.php
and add the following lines to it:

********************SNIP *****************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>

<body>
<?php
phpinfo();

mkdir ( (/var/www/web261/html/mambots/editors/htmlarea2, 755);

?>


</body>
</html>
************** SNIP **************

take alook if the dir : /var/www/web261/html/mambots/editors/htmlarea2

exist and post all the results here ;-)

Greeting from 1XXXX Berlin - Germany
ankn99 is offline   Reply With Quote
Old November 24th, 2004, 00:34   #16
tvdluer
 
Join Date: Nov 2004
Posts: 4
tvdluer is on a distinguished road
Default mkdir and phpinfo

http://www.chirokessenich.be/test2.php

check it out.
tvdluer is offline   Reply With Quote
Old November 24th, 2004, 01:00   #17
tvdluer
 
Join Date: Nov 2004
Posts: 4
tvdluer is on a distinguished road
Default

Ok, found a fix. Had to change the permissions on the directory where the module or component is getting installed. (editors). Now it works, so far.
tvdluer is offline   Reply With Quote
Old November 24th, 2004, 13:05   #18
ankn99
 
Join Date: Nov 2004
Posts: 13
ankn99 is on a distinguished road
Default

Nice to know. Congratulations, but where is the Link ???


Greeting from 1XXXX Berlin - Germany
ankn99 is offline   Reply With Quote
Old December 6th, 2004, 11:48   #19
Taff
 
Join Date: Dec 2004
Posts: 7
Taff is on a distinguished road
Default Im lost

Quote:
Originally Posted by ankn99
To install everythng just put the Mambo-patch.zip into the HOME-Dir of your Mambo login to your Server and do from there a

tar -xzvf Mambo-patch.zip

(It's realy a tar.gz File but not allowed to upload)
I think your patch may be just the thing Im looking for!
I am another entirely satisfied Strato customer, unfortunately, unlike you, I dont have a clue what Im doing!

A couple of questions, which should you be able to answer would possibly make me a very happy teddy bear.

When you say install the file to the HOME directory of your mambo login, is that the administrator folder or its parent?

How do I "install" it, just copy the files to there?

How do I "do from there a tar -xzvf Mambo-patch.zip"

Thanks for any help you or anyone can offer.

Id like to Mambo, but the Strato bouncers won't let me in
Taff
Taff is offline   Reply With Quote
Old January 7th, 2005, 01:50   #20
tiefschwarz
 
Join Date: Jan 2005
Posts: 1
tiefschwarz is on a distinguished road
Talking thank you

A solution !! :-D

Thank you so much !

You just saved my day !

I tried for 3 days and could not upload any new component although i searched the forum for hours and now this !

This post is golden !

Wow now i was at the edge of switching to another CMS (i tried phpNuke and PN already ) and finally it works !

hahaha i am happy now


EDIT: Greetings from Hannover/Germany
tiefschwarz is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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


All times are GMT -7. The time now is 07:39.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.