Search…

X3 Photo Gallery Support Forums

Search…
 
margouillat
Experienced
Topic Author
Posts: 34
Joined: 31 Jul 2011, 09:20

open_basedir

03 Dec 2014, 12:00

Hi Karl
How do I set the path for open_basedir in php.ini with X3

thanks for your great job

JB
Margouillat
loeildumargouillat.fr
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14003
Joined: 30 Sep 2006, 03:37

Re: open_basedir

03 Dec 2014, 12:21

margouillat wrote:How do I set the path for open_basedir in php.ini with X3
May I ask where you got the information that you should change your path for open_basedir? We have been diagnosing the open_basedir setting in regards to X3 recently, and it seems to be relatively harmless to functionality. The only issue seems to be that X3 cannot remove unused PHP template files from within the cache folder, so you once in a while you may need to clean it manually.

Also for next release, we are turning off "notices", so you shouldn't be interrupted by the notice messages at the top when browsing between pages.

To edit the php.ini file, you would in fact need to be running your own virtual server ... If you can change it, you would like set it to:
Code
open_basedir = /
However, if you can change it in the first place, you might as well just disable it because it has not function when just set to /
Code
; open_basedir = /
 
margouillat
Experienced
Topic Author
Posts: 34
Joined: 31 Jul 2011, 09:20

Re: open_basedir

03 Dec 2014, 16:36

No, I wanted to see on a personal server the ability to modify the php.ini

Otherwise I changed hosting this week and everything is ok (check) rewrite, open_basedir. I have not been navigating error message and contact me module display a gray check and not the big red cross, the message is sent.
so for me frontend everything is ok, improvements could be made in the panel as a button to empty the cache as in joomla.

In all it's a great job you're doing Karl congratulations

JB

loeildumargouillat.fr

just forget to tell the installation of the audio module :D
Margouillat
loeildumargouillat.fr
 
User avatar
fsfs
Experienced
Posts: 56
Joined: 24 Apr 2012, 07:28

Re: open_basedir

04 Dec 2014, 03:48

Hmm I get that question too from my host company.

Here is their reply from the mail.
Code
open_basedir specifies which directories PHP can write to.
Reply with complete path and code used so we can examine what you are trying to do.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14003
Joined: 30 Sep 2006, 03:37

Re: open_basedir

04 Dec 2014, 04:54

fsfs wrote:Hmm I get that question too from my host company.
They don't seem to entirely understand how this setting works. Basically the index.php application file in your x3 root folder, wants to create- and modify files in a child /app/_cache/ folder. It can already create the files- and folders even with your open_basedir, but it is not able to delete unused ones that were created by itself earlier.
your host wrote:open_basedir specifies which directories PHP can write to.
Reply with complete path and code used so we can examine what you are trying to do.
The reason I know the above statement is not entirely accurate, is because X3 has already created files- and folders inside the app/_cache/ folder on your server, as you can witness yourself by navigating into /app/_cache/ by FTP. The problem is that for some reason, as diagnosed from the error, your open_basedir restriction is preventing X3 from deleting (with unlink) PHP files that itself has created earlier!

So basically you can reply to them the above, as I can't really make it any clearer: X3 needs to create cache files, and it does so inside /app/_cache/, and even with open_basedir this works fine. However, your open_basedir restriction is preventing X3 from deleting the same files that it has created itself.
 
User avatar
fsfs
Experienced
Posts: 56
Joined: 24 Apr 2012, 07:28

Re: open_basedir

16 Jan 2015, 09:57

The reason I know the above statement is not entirely accurate, is because X3 has already created files- and folders inside the app/_cache/ folder on your server, as you can witness yourself by navigating into /app/_cache/ by FTP. The problem is that for some reason, as diagnosed from the error, your open_basedir restriction is preventing X3 from deleting (with unlink) PHP files that itself has created earlier!

So basically you can reply to them the above, as I can't really make it any clearer: X3 needs to create cache files, and it does so inside /app/_cache/, and even with open_basedir this works fine. However, your open_basedir restriction is preventing X3 from deleting the same files that it has created itself.

I replied to my host, don't know if they are retarded. I asked if I have the access to delete. They replied this:
Hello,

Yes, if you have permission to create the file, you also have permission to delete
file would both fall under the "write access". A simple script to test this
could look like this:
Code
<? php
header ('Content-Type: text / plain \ r \ n ");
$ Droot = $ _SERVER ['DOCUMENT_ROOT'];

// List files into directory
print_r (scandir ($ Droot));

// Create a new file and directory listings
file_put_contents ("$ Droot / testfile", "Hello");
print_r (scandir ($ Droot));

// Delete the file and directory listings
unlink ("$ Droot / testfile");
print_r (scandir ($ Droot));
The above are test driven on an ordinary web hosting account with us
and work well, even together with open_basedir. However, we have unfortunately
no ability to troubleshoot and fix the customer's own code or code
that someone else wrote for our customers.

The website works, I can add/remove pictures. But on /check I get the orange mark on open_basedir:
You server has open_basedir restriction enabled. This seems to be harmless, although it may prevent X3 from removing unused PHP template files within the app/_cache folder.
What should I do to see if i'm affected by this open_basedir?

EDIT: I see that app/_cache is increasing size, few kbs when I delete/create a folder/pictures. The folder should be empty?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14003
Joined: 30 Sep 2006, 03:37

Re: open_basedir

17 Jan 2015, 02:11

To be honest, it seems this open_basedir setting is a bit unclear to all parties, including us. Before X3, I thought the logic was exactly as explained by your host, but apparently that is not entirely correct. With X3 on open_basedir, the following is clear and proven:

- X3 can write all files, no problem.
- X3 can delete all files, EXCEPT php files

I am not sure if the PHP is some configurable limitation in open_basedir or what, but it is clear that the same script that created the PHP files is NOT allowed to delete those PHP files, because we get this error:
Code
open_basedir issue Warning: unlink() [function.unlink]: open_basedir restriction in effect. File() is not within the allowed path(s):
We get that error from the same PHP script that created the files!
fsfs wrote:The website works, I can add/remove pictures. But on /check I get the orange mark on open_basedir: You server has open_basedir restriction enabled. This seems to be harmless, although it may prevent X3 from removing unused PHP template files within the app/_cache folder.
As mentioned, this is likely entirely harmless. The PHP cache files are only refreshed once we release updates, and then you might be storing old PHP template files that are not used. At some point in time, you could just manually empty these folders anyway, and X3 would just need to re-process fresh templates ... no biggie ....
fsfs wrote:What should I do to see if i'm affected by this open_basedir?
Are you actually seeing the "Warning: unlink()" error in your website sometimes? Likely you are affected, but as mentioned above, there is no reason to believe it has any negative impact on your website.
fsfs wrote:EDIT: I see that app/_cache is increasing size, few kbs when I delete/create a folder/pictures. The folder should be empty?
[/quote]
The cache definitely will be increasing in size, especially because X3 resizes and caches your images in /_cache/images/. The images cache is another story altogether, and is not controlled by X3, because X3 doesn't really know when an image has been deleted/rename and won't there be deleting old image cache files. At some point, you could manually empty the images cache also, but it is not really necessary. As for the PHP templates cache, as mentioned, X3 is normally able to delete "unused" template files, but seemingly not in the case of open_basedir. I think it is harmless.
 
User avatar
fsfs
Experienced
Posts: 56
Joined: 24 Apr 2012, 07:28

Re: open_basedir

18 Jan 2015, 03:08

Okey, thanks for the info.
mjau-mjau wrote:Are you actually seeing the "Warning: unlink()" error in your website sometimes? Likely you are affected, but as mentioned above, there is no reason to believe it has any negative impact on your website.
No I haven't, but I remember seen this before in previous versions. Maybe first or second beta.
Don't know if it's permission issue....the v8, the only difference I made was chmod 777 for all files, just wanted everything to work :P


Keep up the good work.