Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ADMIN.. "File in wrong directroy" errors


evolutionweb

Recommended Posts

Example:

--

Warning: open_basedir restriction in effect. File is in wrong directory in /home/httpd/vhosts/xxxxxx.com/httpsdocs/catalog/admin/file_manager.php on line 178

 

Fatal error: Call to a member function on a non-object in /home/httpd/vhosts/americanpaintballs.com/httpsdocs/catalog/admin/file_manager.php on line 179

 

--

I always install everything the way it comes out of the distribution. It has worked on several installs ( after some messing with config files ) Then I saved a "standard" functional config file to reuse since I always use same server with same paths, changed only for domain name. :(

I'm Paul. We developer in Miami Florida since 1995. Not a PHP programmer...I just muddle through with moderate success !

Link to comment
Share on other sites

As per: www.php.net

 

In your PHP.INI settings

 

open_basedir <string>

Limit the files that can be opened by PHP to the specified directory-tree, including the file itself. This directive is NOT affected by whether Safe Mode is turned On or Off.

 

Thus you should have some thing like this in php.ini or for vhost in httpd.conf (if configured):

 

open_basedir .:/tmp:/usr/local/lib/php:/home/httpd/vhosts/your_domain.com/httpsdocs/

 

If you using the same host - it is possable that it may be on a differnt phyiscal server and thus this was missed for that server or just for your Vhost???

 

Take a look at your PHP setting

 

Good Luck!

Link to comment
Share on other sites

As per: www.php.net

 

In your PHP.INI settings

 

open_basedir <string>

Limit the files that can be opened by PHP to the specified directory-tree, including the file itself. This directive is NOT affected by whether Safe Mode is turned On or Off.

 

=====

 

Where do I find this php.ini file? I have look in all of the folders associated with the shopping cart.

 

PK

I'm Paul. We developer in Miami Florida since 1995. Not a PHP programmer...I just muddle through with moderate success !

Link to comment
Share on other sites

This is NOT a file included with OSC - this is a server side file - whom ever admin the server will have to check/make changes. If you own the server then you should have a file PHP.INI some where in your configuration and setup of the PHP programs that run on the server or have it setup in Apache's HTTPD.CONF file (if allowed) on a per site bases.

 

Ask whom every is your host is to make these changes.

Link to comment
Share on other sites

This is NOT a file included with OSC - this is a server side file - whom ever admin the server will have to check/make changes.  If you own the server then you should have a file PHP.INI some where in your configuration and setup of the PHP programs that run on the server or have it setup in Apache's HTTPD.CONF file (if allowed) on a per site bases.

 

Ask whom every is your host is to make these changes.

 

============

 

Would this make it necessary to add to this conf file every time I installed a copy of the cart for another domain name? There must be an easier way to solve this if that is the case.

 

Any suggestions?

 

Paul

I'm Paul. We developer in Miami Florida since 1995. Not a PHP programmer...I just muddle through with moderate success !

Link to comment
Share on other sites

If set into php.ini then it will work for all sites/virtual domains that server is running.

 

If set in httpd.conf (there is only 1 of these files per server) then it has to be set manually for each of your virtual domain specified in this file.

When one is set and working then cut'n paste the correct part of the file to the other virtual domains that needs this.

 

All of the above has to be done by whom ever hosting your site. You must have ROOT like access to modify these files.

 

If done in .htaccess (if allowed in httpd.conf) then you can cut and past the file to other directories that does not already have a .htaccess (or add into exisiting files) that a .php files exists/runs from.

 

If you have a ton of web sites with a single provider and (or you should buy) bought (or rent/lease - whatever) a whole/dedicated server. Then whomever does the hosting should set the php.ini for your server - that is the easiest thing to do. If you have several sites with one host - you may ask the host to place them all on the same servers or atleaset on the same like hardware/software.

 

Bottom line - ask your host to change - if they give you trouble - I can suggest a few other good hosts that are much more felxable and have reasonable rates (BTW I don't get any $$ for refering people to these host - If I did I would be rich by now - but then again there rates would be much higher)

Link to comment
Share on other sites

If set into php.ini  then it will work for all sites/virtual domains that server is running.

 

If set in httpd.conf (there is only 1 of these files per server) then it has to be set manually for each of your virtual domain specified in this file.

When one is set and working then cut'n paste the correct part of the file to the other virtual domains that needs this.  

 

All of the above has to be done by whom ever hosting your site.  You must have ROOT like access to modify these files.

 

If done in .htaccess (if allowed in httpd.conf) then you can cut and past the file to other directories that does not already have a .htaccess (or add into exisiting files) that a .php files exists/runs from.  

 

If you have a ton of web sites with a single provider and (or you should buy) bought (or rent/lease - whatever) a whole/dedicated server.  Then whomever does the hosting should set the php.ini for your server - that is the easiest thing to do.  If you have several sites with one host - you may ask the host to place them all on the same servers or atleaset on the same like hardware/software.

 

Bottom line - ask your host to change - if they give you trouble - I can suggest a few other good hosts that are much more felxable and have reasonable rates (BTW I don't get any $$ for refering people to these host - If I did I would be rich by now - but then again there rates would be much higher)

 

================

 

Thanks. I do have a whole server to myself with root access. I will make changes to allow use of .htaccess files so I don' t need to mess with server config files in the future. I am pretty new to PHP so just learning some of the ins and outs of this. I can make changes to the PHP.INI and other files and would then make a "default" change to the .htaccess file in my archived set of files for the cart then change them to suit upon installation just as I do now with the configure.php files.

 

Many thanks for your time and feed back. Have a great day.

I'm Paul. We developer in Miami Florida since 1995. Not a PHP programmer...I just muddle through with moderate success !

Link to comment
Share on other sites

Then the BEST thing to do it to edit PHP.INI and change the default then "down" and "restart" the web server software. - 30 second change! (it will more than likely take more time to find php.ini and edit it than to restart the s/w to load the php.ini settings.)

Link to comment
Share on other sites

:!: I was working on this error for a few days and searching this board for an answer. There were suggestions about the .htaccess files and the php.ini. I didnt have access to the ini, and none of the suggested .htaccess fixes did the trick.

:idea: I noticed that every line of code pointed to by this error contained the "file_exists" php function.

http://us4.php.net/manual/en/function.file-exists.php

:wink: It so happens that there is something about this problem posted on that page by a user. To sum it up, you need to replace this:

if (file_exists($filename))

With this:

if(file_exists(realpath($filename)))

:( The down side...you need to do this in a lot of places all over your oscommerce site

Having liberty is one thing, keeping it is another...

Link to comment
Share on other sites

:( Well that worked only for the instances where the code was looking for the existence of a file. Unfortunately there are plenty more things that cause this error....Sorry!

Having liberty is one thing, keeping it is another...

Link to comment
Share on other sites

Then that may be due to "symlinked" directories.

 

There are 2 eaiser fixes:

 

1) Ask your host to modify PHP.INI and disallow in all vhost in HTTPD.CONF - and allow for your (or a per request) site only. The .htaccess will only work if it was allowed to be "toggled on/off" in PHP.INI and HTTPD.CONF.

 

2) Suggest a better host that is more willing to keep his customers happy and allow this setting. I can suggest a few good ones that don't steal you blind if you PM me. (I don't get $ anything $ from doing this. Other than satifaction.)

 

 

If you want to change all files to this format - I would suggest using NoteTab (multiple cross-file text editor).

 

Install shareware then associate PHP with NoteTab

 

In each directory select all the files then right click then select OPEN (this is the most time consuming part) Don't do images or CSV dircetories. (took me 15 mins). Do it in small section if need be-

 

Do a search and replace. Select "Search" as "ALL" and "Scope" as ALL DOCUMENTS. (I found like 35 "file_exists" which was replaced in 3 min)

 

To save would only take a few min. 1 Hour tops - including download of Notetab.

 

 

then do a bulk SEARCH & REPLACE in using "ALL" files.

 

 

Goodluck

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...