Hi Karl
How do I set the path for open_basedir in php.ini with X3
thanks for your great job
JB
X3 Photo Gallery Support Forums
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.margouillat wrote:How do I set the path for open_basedir in php.ini with X3
open_basedir = /
; open_basedir = /
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.
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.fsfs wrote:Hmm I get that question too from my host company.
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!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.
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:
The above are test driven on an ordinary web hosting account with usCode<? 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));
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.
What should I do to see if i'm affected by this 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.
open_basedir issue Warning: unlink() [function.unlink]: open_basedir restriction in effect. File() is not within the allowed path(s):
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: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.
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:What should I do to see if i'm affected by this open_basedir?
[/quote]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?
No I haven't, but I remember seen this before in previous versions. Maybe first or second beta.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.