SOLVED - JFolder::create: Path not in open_basedir paths

Need help with the Administration of your Joomla! 1.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
User avatar
borderless
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Mar 03, 2008 10:41 pm
Location: Austria
Contact:

SOLVED - JFolder::create: Path not in open_basedir paths

Post by borderless » Tue Mar 18, 2008 10:45 pm

Uppon trying to install new modules or extensions i was always presented with following error:
  • JFolder::create: Path not in open_basedir paths
    Could not create directory ...
after doing some research i found out, that the problem was, indeed, caused by the open_basedir php-setting (how obvous, you say.. :))
if you also encounter this error, do the following:

Check:
  1. Click on the Menu Help->System Info
  2. Click on the second tab, named PHP Settings
  3. Check the line with the Setting "Open Basedir" (usually the second line from top)
    if your setting is Virtual_Document_Root, you might want to try the following, which solved the issue for me
Patch:
  1. Go (with any ftp program) to your Joomla directory and change to the directory libraries->joomla->filesystem
  2. download the file folder.php to your computer (dont forget to create a backup copy at this point, just in case)
  3. open the local copy of the folder.php file with a texteditor and find the line number 203
  4. insert following line of code here (after the foearch and bevore the JPath::Clean statements)

    Code: Select all

     if ($test=='VIRTUAL_DOCUMENT_ROOT') { $test = $_SERVER['DOCUMENT_ROOT']; } // MOD HERE!!
  5. save the changes and upload the file again (overwrite the old one)
  6. done
What does the patch do?
Some webspace hosts have the open_basedir setting set to the placeholder (variable) Virtual_Document_Root, which means, every user can only access his/her own webspace. Joomla does not handle this kind of open_basedir variable, so it assumes that you can only access the directory named Virtual_Document_Root (which does not exist) and prompts you with an error.
Now you just inserted a line of code, which checks for this open_basedir variable and replaces it with your real document root path, so joomla can compare this.


hope this works for you, good luck and have fun ;D
- pino

bnecom
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Sat Nov 05, 2005 9:53 pm
Location: Brisbane, Australia

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by bnecom » Sat Apr 05, 2008 9:33 am

Hi Pino

Please be more specific as to where this line of code is to be inserted.

Jason

User avatar
borderless
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Mar 03, 2008 10:41 pm
Location: Austria
Contact:

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by borderless » Sat Apr 05, 2008 12:03 pm

Well, you modify the file
/libraries/joomla/filesystem/folder.php

insert the modification (the condition) at line number 203:
this is in the JFolder class, in the create function

the structure looks a little bit like this:

Code: Select all

029: class JFolder{
---    ...
137:   function create {
---      ...
149:     if (!JFolder::exists($parent)) { ... }
---      ...
170:     if (JFolder::exists($path)) { ... }
---      ...
175:     if ($FTPOptions['enabled'] == 1) {
---        ...
185:     } else {
---        ...
191:       if ($obd != null) {
---          ...
202:         foreach ($obdArray as $test) {
203:           if ($test=='VIRTUAL_DOCUMENT_ROOT') { $test = $_SERVER['DOCUMENT_ROOT']; } // MOD HERE
204:           $test = JPath::clean($test);
---            ...
210:         }
---          ...
216:       }
---        ...
230:     }
---      ...
232:   }
---    ...
526: }
this should explain the exact position in the file and class structure, and if your folder.php file was not modified before (i.e. the linenumbers are still unmodified), then you can simply use the line-number 203 as a reference to the position of the modification
- pino

bnecom
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Sat Nov 05, 2005 9:53 pm
Location: Brisbane, Australia

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by bnecom » Sat Apr 05, 2008 10:46 pm

Thanks Pino

Didn't solve my problem :(

Jason

iguana007
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Fri Mar 16, 2007 9:00 am
Location: Prague, Czech republic
Contact:

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by iguana007 » Tue May 13, 2008 6:11 pm

Doesnt solve my problem too... :(

User avatar
humvee
Joomla! Master
Joomla! Master
Posts: 14704
Joined: Wed Aug 17, 2005 10:27 pm
Location: Kent, England

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by humvee » Tue May 13, 2008 8:20 pm

Try providing a little more information about your server and settings and whether you are experiencing the exact same problem and messages.

Complete the Forum Post Assistant extended version.

Andy

User avatar
M4rc0
Joomla! Explorer
Joomla! Explorer
Posts: 311
Joined: Wed Sep 27, 2006 1:47 pm
Contact:

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by M4rc0 » Tue May 20, 2008 5:38 am

Didn't work for me either. Could somebody help me with this?
I'm totally stuck with my work as i can't install anything.

My joomla instalation is located at:
/home/restricted/home/sitenam/public_html/v2/*.*

And here is my basedir described in the php settings information:
Open basedir: /home/restricted/home/sitename

funny because $log_path and $tmp_path are correct in the configuration file.
-----

jts-post diagnostic:
Problem Description:
I can\'t install any template or plugin:

* JFolder::create: Path not in open_basedir paths
* Unable to create destination



Diagnostic Information
Joomla! Version: Joomla! 1.5.3 Production/Stable [ Vahi ] 22-April-2008 22:00 GMT
configuration.php: Writable (Mode: 777 ) | RG_EMULATION: N/A
Architecture/Platform: Linux 2.4.21-57.ELsmp ( i686) | Web Server: Apache ( www.rarima.com.br ) | PHP Version: 5.1.6
PHP Requirements: register_globals: Disabled | magic_quotes_gpc: Enabled | safe_mode: Disabled | MySQL Support: Yes | XML Support: Yes | zlib Support: Yes
mbstring Support (1.5): Yes | iconv Support (1.5): Yes | save.session_path: Writable | Max.Execution Time: 60 seconds | File Uploads: Enabled
MySQL Version: 5.0.41--log ( mysql01.estadodeexcelencia.com.br via TCP/IP )

Extended Information:
SEF: Disabled (without ReWrite) | FTP Layer: Disabled | htaccess: Not Implemented
PHP/suExec: User and Web Server accounts are not the same. (PHP/suExec probably not installed)
PHP Environment: API: apache2handler | MySQLi: Yes | Max. Memory: 64M | Max. Upload Size: 30M | Max. Post Size: 30M | Max. Input Time: 60 | Zend Version: 2.1.0
Disabled Functions: escapeshellarg, escapeshellcmd, exec, passthru, proc_close, proc_open, shell_exec, system, dl, popen, show_source, highlight_file, php_check_syntax, php_strip_whitespace, symlink, link, suexec, proc_get-status, proc_nice, proc_terminate, pclose, virtual, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, openlog
MySQL Client: 4.1.21 ( latin1 )


User avatar
humvee
Joomla! Master
Joomla! Master
Posts: 14704
Joined: Wed Aug 17, 2005 10:27 pm
Location: Kent, England

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by humvee » Wed May 21, 2008 7:28 am

The editing of the files is not recommended (or should be necessary) if all the files are correctly/completely uploaded to the server and the server has the correct settings.
@M4rc0
You say you cannot install anything...do you mean Joomla! itself or do you mean components. Assuming you mean the former try activating the .htaccess file in particular the mod_rewrite and then rewrite_base making sure this directs to the correct directory, and edit the Global Configuration to enable the mod_rewrite also a possible influence might be the var $live_site in the Joomla! configuration.php.

hth

Andy

User avatar
M4rc0
Joomla! Explorer
Joomla! Explorer
Posts: 311
Joined: Wed Sep 27, 2006 1:47 pm
Contact:

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by M4rc0 » Wed May 21, 2008 8:16 pm

Yes i meant i can't install any component or template

I just survived a instalation with a migration script..and i tought my problems would be gone!

So, from what you said i have 2 options:

- .htaccess: just renamed the txt to .htaccess, the only thing i added was

Code: Select all

 RewriteBase /public_html/v2
and it didn't work, i get a 500 error. That's a problem because it's a shared hosting, and i can't make it work properly.
I tried commenting Options +FollowSymLinks with no success as well.
I will try more as this sounds like the best solution.

- $live_site in configuration.php: i added http://www.rarima.com.br/v2/index.php
is that it? that's the path i need? didn't work.

I'm stuck and lacking of options.

Thanks for the help Andy!

User avatar
humvee
Joomla! Master
Joomla! Master
Posts: 14704
Joined: Wed Aug 17, 2005 10:27 pm
Location: Kent, England

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by humvee » Thu May 22, 2008 8:33 am

No the htaccess mods were only if Joomla! would not install...
If it is the Extensions, then depending on the error message you are getting you need to ensure you have the correct ftp layer details entered in the Global Configuration/configuration.php, the correct permissions on the directories and/or the correct level of settings in the php configuration as per my note in 1.0 Help Screens:
There is usually an upper limit to the size of image files that can be uploaded through the Media Manager. This upper limit is indicated by, for example, "[Max = 8M]", which indicates that files bigger than 8 megabytes cannot be uploaded. This limit is set in the PHP configuration file (php.ini) and may differ between web servers and web hosts. The limit cannot be altered from within Joomla! Some hosting companies do not allow the limit to be altered at all!

To allow larger files to be uploaded it will probably be necessary to increase the upload_max_filesize and the post_max_size settings.

For very large files it may also be necessary to increase the max_execution_time and the memory_limit settings.

User avatar
M4rc0
Joomla! Explorer
Joomla! Explorer
Posts: 311
Joined: Wed Sep 27, 2006 1:47 pm
Contact:

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by M4rc0 » Fri May 23, 2008 12:22 pm

It works!!!

thank you!

now i can finally work :D

It was the ftp layer, i entered the settings in the global configuration and it worked well
(actually i didn't know ftp was necessary)

So far so good. :pop

User avatar
humvee
Joomla! Master
Joomla! Master
Posts: 14704
Joined: Wed Aug 17, 2005 10:27 pm
Location: Kent, England

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by humvee » Fri May 23, 2008 12:48 pm

FTP Layer has been added to resolve the issues you have experienced caused by Linux permissions amongst other things - which is precisely what you have been hit with.

Anyway glad it has resolved now, and you are able to get on.

Regards

Andy

Jim the Chin
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 230
Joined: Mon Apr 10, 2006 12:15 pm
Location: Cromer, Norfolk, UK

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by Jim the Chin » Mon May 26, 2008 11:37 am

Hi

I've tried the steps suggested here but still get and error when trying to install component.

The way I've read this thread, it seems that enabling ftp is a possible solution? If so, is it that I enable ftp in Global Configuration then try installing?
Signature rules http://forum.joomla.org/viewtopic.php?f=8&t=65
Only exact urls allowed

User avatar
M4rc0
Joomla! Explorer
Joomla! Explorer
Posts: 311
Joined: Wed Sep 27, 2006 1:47 pm
Contact:

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by M4rc0 » Mon May 26, 2008 2:22 pm

Exactly Jim.

Just enable the FTP layer with the correct settings and you are go to go (i hope).

Read my posts above, i tried everything too before the FTP solution.

User avatar
humvee
Joomla! Master
Joomla! Master
Posts: 14704
Joined: Wed Aug 17, 2005 10:27 pm
Location: Kent, England

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by humvee » Mon May 26, 2008 3:07 pm

Configure FTP layer in GC using the same settings as you would use in your FTP client. See my post at the top of the Admin Forum for further details.

Andy

Jim the Chin
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 230
Joined: Mon Apr 10, 2006 12:15 pm
Location: Cromer, Norfolk, UK

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by Jim the Chin » Mon May 26, 2008 5:10 pm

Many thanks for your suggestions . I've done as you suggest but still get error messages when I try to install extension...
JFTP::login: Bad Password
JFTP::_passive: Unable to obtain IP and port for data transfer
JFTP::store: Unable to use passive mode
Warning! - Failed to move file

I checked my password ... it's okay for ftp client? What do the other errors mean?
Signature rules http://forum.joomla.org/viewtopic.php?f=8&t=65
Only exact urls allowed

User avatar
humvee
Joomla! Master
Joomla! Master
Posts: 14704
Joined: Wed Aug 17, 2005 10:27 pm
Location: Kent, England

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by humvee » Mon May 26, 2008 6:30 pm

when you connect using your FTP client do you direct it via FTP or SFTP (Secure File Transfer Protocol) as the ports will be different,

Jim the Chin
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 230
Joined: Mon Apr 10, 2006 12:15 pm
Location: Cromer, Norfolk, UK

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by Jim the Chin » Mon May 26, 2008 6:38 pm

I connect via FTP
Signature rules http://forum.joomla.org/viewtopic.php?f=8&t=65
Only exact urls allowed

User avatar
humvee
Joomla! Master
Joomla! Master
Posts: 14704
Joined: Wed Aug 17, 2005 10:27 pm
Location: Kent, England

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by humvee » Mon May 26, 2008 7:06 pm

Well for whatever reason the fact that it is not accepting your password when you try the connection is causing the other errors passive I think I am right in saying occurs when you do not need to use a password at all for some servers which clearly your web site would not be like.

Are you actively using your FTP Client to access your web server?

You need to take the detail exactly as it is for this client for all the FTP variables in configuration.php. The likely problem is likely to be with the path as it needs to be entered into Joomla!

Andy

Jim the Chin
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 230
Joined: Mon Apr 10, 2006 12:15 pm
Location: Cromer, Norfolk, UK

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by Jim the Chin » Tue May 27, 2008 5:41 pm

Hi Andy

Yes, I'm actively using FTP.

I've had some success ... after modifying the path as suggested, I've got some extensions to install but still I get error messages such as "JFTP::store: Bad response Warning! - Failed to move file" and messages saying that the folder already exists so couldn't be written. So, I'm almost there!
Signature rules http://forum.joomla.org/viewtopic.php?f=8&t=65
Only exact urls allowed

User avatar
humvee
Joomla! Master
Joomla! Master
Posts: 14704
Joined: Wed Aug 17, 2005 10:27 pm
Location: Kent, England

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by humvee » Sat May 31, 2008 3:13 pm

sobabe wrote:I have the same error message. What's strange is that I could upload and install templates and modules and everything yesterday and today I'm trying to install comment modules but nothing works :(
don't know what to do. Thanks for your help
Which extension specifically as that may be where the problem rests? Is it a larger file size than other extensions that you have installed up until now?
Just as a matter of interest what are the upload limits that have been set in php.ini?

Andy

User avatar
humvee
Joomla! Master
Joomla! Master
Posts: 14704
Joined: Wed Aug 17, 2005 10:27 pm
Location: Kent, England

Re: SOLVED - JFolder::create: Could not create direc

Post by humvee » Sat May 31, 2008 3:21 pm

sabaidee49 wrote:I have a similar problem but it concerns the following;
* JFolder::create: Could not create directory
* Warning! - Failed to move file
I tried the ftp option but it created more errors, instead of solving the problem.
Any other ideas?
thanks in advance. :eek:
This would be unlikely if the settings entered were correct for your particular server, but they can be a PITA to establish . What are the additional errors that you start receiving?
As with sobabe what are the server upload limits?

Andy

Jooming
Joomla! Intern
Joomla! Intern
Posts: 91
Joined: Wed Apr 02, 2008 4:23 am

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by Jooming » Sat May 31, 2008 9:38 pm

Humvee,

I need your help!! I have been dealing with this problem for over a week now and have found no solutions whatsoever. I am done trying to fix it. All I want to do now is to get my site back up so I can back it up and then delete Joomla! and my DB. Then, I want to create a new DB and install the old Joomla!

The problem is, my site is not available any more and I can't change the configuration.php file. Joomla! has erased the config file and when I try and paste the contents of it back in using File Manager on the server OR using an FTP Client, Joomla! won't let me save/change anything. It doesn't matter what permissions I have set for it or who/what the ownership is set at, I can't bring it back!

Can you please tell me how I can paste the contents back into configuration.php and make it stick?

Thanks,
Bill
Jooming (Bill) :)

Jooming
Joomla! Intern
Joomla! Intern
Posts: 91
Joined: Wed Apr 02, 2008 4:23 am

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by Jooming » Sat May 31, 2008 10:40 pm

OK, I accessed the joomla directory using Filezilla and was able to delete the configuration.php file completely after changing its name to "configuration_old.php". I then tried to upload a backup of that file (with a few minor modifications) but the server would not let me!

Got this warning:
550 configuration.php: Disk quota exceeded

This is impossible!!! I have 5GB allocated for this website and have 10GB allocated for transfer. I have not used anywhere near that amount! Further, the file I am trying to upload is only 1683 bytes! There is no misspelling of the file name and no spaces... it's simply: configuration.php

Why would I be getting this error???

This is ridiculous! All I am trying to do is upload a stinking file through FTP into a directory!! >:(

Can someone... ANYONE HELP ME??? I have been asking for help on this forum for over a week and was only helped by a few other users who also are experiencing the same problems that I am!!! Is there anyone out there that knows how to fix this??? PLEASE!!!
Jooming (Bill) :)

User avatar
Smartie
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 115
Joined: Tue May 16, 2006 5:55 pm
Location: Nederland

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by Smartie » Mon Jun 02, 2008 5:38 pm

At the dutch board people installed Joomla! again but they enabled the ftp layer at the installation.
I didn't saw any negative comment. Didn't tested myself but will do it tomorrow..

Jooming
Joomla! Intern
Joomla! Intern
Posts: 91
Joined: Wed Apr 02, 2008 4:23 am

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by Jooming » Mon Jun 02, 2008 7:15 pm

The first time I installed Joomla! I enabled the FTP layer during installation... and I still had problems. I would like to know if I should or shouldn't enable the FTP layer during installation?? The first go-round, I did everything to the "T" as was specified in the Joomla! installation instructions, and it failed miserably!

Is there some other way to install 1.5 that isn't listed in the instructions?

Thanks,
Bill
Jooming (Bill) :)

User avatar
kane738
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Mon Oct 02, 2006 2:48 pm
Location: UK
Contact:

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by kane738 » Mon Jun 02, 2008 7:58 pm

Had a problem with the FTP layer and it was finally solved by doing chown -R ftpuser:ftpgroup * in the root joomla folder (using SSH). This was on a 1&1 linux server which seems to be set up a bit weird. Went through loads of things trying to sort it - with the FTP layer off, installing stuff/writing to the config file wouldn't work even when everything was chmod'd to 777. Tried the fix at the start of this post and it didn't make any difference.
Now it all seems to work with files 664 and directories 755.

http://forum.joomla.org/viewtopic.php?t=121470
was pretty useful, as was this
http://forum.joomla.org/viewtopic.php?f=428&p=1251605
and a few others I've I can't remember (been at it all day!)

Hope that helps.
Cheers to all the forum posts I read that got me there in the end!
:-)

Jooming
Joomla! Intern
Joomla! Intern
Posts: 91
Joined: Wed Apr 02, 2008 4:23 am

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by Jooming » Mon Jun 02, 2008 8:19 pm

Thanks kane738,

I appreciate the links you offered! I am going to try and do a clean install of 1.5.1 instead of 1.5.3. From what I have read all over the forum, troubles didn't seem to start until v1.5.2.

I hope I have luck this time!

Thanks again,
Bill
Jooming (Bill) :)

Jooming
Joomla! Intern
Joomla! Intern
Posts: 91
Joined: Wed Apr 02, 2008 4:23 am

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by Jooming » Mon Jun 02, 2008 8:24 pm

Does anyone know where I can download 1.5.1 stable? Cannot find it on Joomla!
Jooming (Bill) :)

Jim the Chin
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 230
Joined: Mon Apr 10, 2006 12:15 pm
Location: Cromer, Norfolk, UK

Re: SOLVED - JFolder::create: Path not in open_basedir paths

Post by Jim the Chin » Mon Jun 02, 2008 9:16 pm

Jooming wrote:Does anyone know where I can download 1.5.1 stable? Cannot find it on Joomla!
I sent you PM
Signature rules http://forum.joomla.org/viewtopic.php?f=8&t=65
Only exact urls allowed


Locked

Return to “Administration 1.5”