Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Site breaks, get error after moving site up to top from sub folder


allaboutwicker

Recommended Posts

I am hoping someone can give me advice as to how to correct this error. I have my new 2.3.4 site running fine in a sub folder. However, I am now trying to move it up to the top and I get the following error:

 

 

Warning: require(DIR_WS_FUNCTIONScompatibility.php) [function.require]: failed to open stream: No such file or directory in /bla...bla...bla.../includes/application_top.php on line 42

Warning: require(DIR_WS_FUNCTIONScompatibility.php) [function.require]: failed to open stream: No such file or directory in /bla...bla...bla...includes/application_top.php on line 42

Fatal error: require() [function.require]: Failed opening required 'DIR_WS_FUNCTIONScompatibility.php' (include_path='.:/opt/alt/php53/usr/share/pear:/opt/alt/php53/usr/share/php') in /bla...bla...bla.../includes/application_top.php on line 42

 

 

The admin side appears to be functioning, but the front end is not.

 

Thanks in advance for any help.

Link to comment
Share on other sites

It looks like you have deleted the define for DIR_WS_FUNCTIONS in your includes/configure.php. You should be able to copy that line from the site in the subdirectory, as it would not have changed.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi Jim, I just checked again and that is in both. The only differences in the 2 files is the subdirectory configure.php has "oscom" in a few places of course. 

 

The top configure.php has this:

 

define('HTTP_COOKIE_PATH', '/');  
define('HTTPS_COOKIE_PATH', '/');  
define('DIR_WS_HTTP_CATALOG', '/');  
define('DIR_WS_HTTPS_CATALOG', '/');  
define('DIR_WS_IMAGES', 'images/');  
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');  
define('DIR_WS_INCLUDES', 'includes/');  
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');  
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');  
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');  
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');  
define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');  
define('DIR_FS_CATALOG', '/bla..bla..bla.../public_html/');
 
and the subdirectory is like this for that part:
 
define('HTTP_COOKIE_PATH', '/oscom/');  
define('HTTPS_COOKIE_PATH', '/oscom/');  
define('DIR_WS_HTTP_CATALOG', '/oscom/');  
define('DIR_WS_HTTPS_CATALOG', '/oscom/');  
define('DIR_WS_IMAGES', 'images/');  
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');  
define('DIR_WS_INCLUDES', 'includes/');  
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');  
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');  
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');  
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');  
define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');  
define('DIR_FS_CATALOG', 'bla..bla...bla.../public_html/oscom/');
 
So you see the functions part is there, no?
Link to comment
Share on other sites

It's looking for a / before compatibility.php

 

'DIR_WS_FUNCTIONScompatibility.php' 

 

Try define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . '/functions/'); 

 

Although it should work the way you have it.

Link to comment
Share on other sites

Hold on, there! First of all, what exactly are you trying to accomplish here? People break their sites all the time trying to move "from sub-folder to top". That's never necessary, and it's not a good thing to do. It's always better to leave your major applications in their own sub-folders, so that 1) you don't interfere with system files at the top level, and 2) you can add other applications in the future without their stepping on each other. If you don't like visitors having to type in the sub-folder name (such as "catalog"), simply add a URL rewrite to your /.htaccess file to automatically insert the sub-folder in URIs. When you add more applications later, you can remove the rewrite and add a top-level master page with links to your applications.

Link to comment
Share on other sites

Thanks for the suggestion @@Hotclutch. I tried that, but it still did not work :( Any other ideas? I think I understand what you are saying @@MrPhil as I have seen some of your posts, but we have had the site up on top for years with the older 2.2 version until recently when we needed to switch to new version of course due to issues with the 2.2. We do not plan on having any other applications other then the store front on the site at this time and really need this up on top if possible.

 

Thanks again for any advice.

Link to comment
Share on other sites

OK, if you have an existing site history with osC "on top", you might want to retain that structure so that you don't lose SEO position. It shouldn't have been done in the first place, but that's water under the bridge. This forum gets requests all the time for "how do I move my store out of catalog and into root", and my response is always "don't do that".

 

In your case, you clearly missed (or messed up) something in the configure.php files. Be very careful that you don't swap any files between the catalog (customer) side and the admin side -- they're not interchangeable, especially the configure.php files. It's very common for careless store owners to put the admin configure.php file into the catalog, or vice-versa, while uploading after editing.

Link to comment
Share on other sites

OK, if you have an existing site history with osC "on top", you might want to retain that structure so that you don't lose SEO position. It shouldn't have been done in the first place, but that's water under the bridge. This forum gets requests all the time for "how do I move my store out of catalog and into root", and my response is always "don't do that".

 

In your case, you clearly missed (or messed up) something in the configure.php files. Be very careful that you don't swap any files between the catalog (customer) side and the admin side -- they're not interchangeable, especially the configure.php files. It's very common for careless store owners to put the admin configure.php file into the catalog, or vice-versa, while uploading after editing.

I agree. It's very easy to make a mistake with the configure files. Put a slash where there was not one before or vice versa, etc. If your shop is working at the catalog level but not at the root level, then most likely there's an error in the config files.

Link to comment
Share on other sites

Thanks guys for trying to help. Here is my .htaccess file:

 

# $Id$
#
# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
# <Directory "/usr/local/apache/htdocs">
#   AllowOverride Options
# </Directory>
#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)
 
# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers
 
#<IfModule mod_setenvif.c>
#  <IfDefine SSL>
#    SetEnvIf User-Agent ".*MSIE.*" \
#             nokeepalive ssl-unclean-shutdown \
#             downgrade-1.0 force-response-1.0
#  </IfDefine>
#</IfModule>
 
# If Search Engine Friendly URLs do not work, try enabling the
# following Apache configuration parameter
 
# AcceptPathInfo On
 
# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)
 
# php_value session.use_trans_sid 0
# php_value register_globals 1

 

 

 

And here is my .htaccess file in includes folder: I tried it with and without the Rewrite code and it does not change anything:

 

# $Id$
#
# This is used with Apache WebServers
# The following blocks direct HTTP requests in this directory recursively
#
# For this to work, you must include the parameter 'Limit' to the AllowOverride configuration
#
# Example:
#
#<Directory "/usr/local/apache/htdocs">
#  AllowOverride Limit
#
# 'All' with also work. (This configuration is in your apache/conf/httpd.conf file)
#
# This does not affect PHP include/require functions
#
 
<Files *.php>
Order Deny,Allow
Deny from all
</Files>
RewriteCond %{HTTP_HOST} !^www\. 
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1[R=301,L]
 
Does anything look out of sorts to you?
 
Perhaps i should try to overwrite all the files again that I have backed up from my sub directory over the top folders to see if perhaps that got messed up when I originally did it? I was having some issues with my ftp program so maybe something did not transfer properly.
Link to comment
Share on other sites

I just sent a message to my host company to see if they had any clues and this is their response:

 

----------------------------------------------------------------

Hello,

You'll need to delete this folder and its content and redo it using the subdomains feature at (bla.....bla....bla.... link to host cpanel for subdomains)

Create the subdomain on this page and you can set the document root and any redirections. Once the subdomain is created, the respective folder will be created in the correct location. Please note that you are dealing with php scripts and mysql databases so simply copying all the content over will not always make it work. You need to make sure your mysql info is also correct and any paths are properly configured.

----------------------------------------------------------------------------------

 

I am going to check into what they have suggested later today when have a block of time to see if that will work. I will update my progress once I am able to do so.

 

Thanks again for any suggestions!

Link to comment
Share on other sites

The first .htaccess file you gave is completely inactive (all lines are commented out, with #). The second .htaccess file only denies access to .php files and then rewrites domain.com to www.domain.com. It's a bit unusual to deny access to .php files -- was it working like that before? Also, this is in the includes/ directory? I suppose it would be OK to have this in there, but no one should be directly accessing that directory, so I'm puzzled as to why the domain rewrite is in there.

 

Your host's answer is nonsense. They did not understand your question -- you aren't trying to do anything with a subdomain. Did some self-proclaimed "expert" try to help you set up your site, or are you fumbling through it yourself? I'm worried about where you're trying to set up/customize your .htaccess file. First /.htaccess is processed, and then /catalog/.htaccess, etc. down the line to whatever directory you're in, such as /catalog/admin/.htaccess. You might have other .htaccess files to control access if someone goes where they shouldn't (e.g., includes/) but they normally aren't processed.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...