Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default 403 Error only on configuration.php in Admin

    We are using Zen Cart 1.5.6b and recently switched to a new host a couple months ago. The admin has been working fine but today I tried to access the 'Images' settings in the configuration and I got an Error 403. I know this has to do with the permissions, and the permissions for this file are '644'. Is this the correct setting? I'm pretty sure every file has the same permissions as the files on the server we used before this one and it worked fine on that server. Thank you in advance to whoever can help!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: 403 Error only on configuration.php in Admin

    Ask your hosting company to inspect false rejections caused by server-imposed security rules. Perhaps in SELinux.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default Re: 403 Error only on configuration.php in Admin

    I have reached out to them but now I'm wondering if it is a .htaccess issue. Is there a clean .htaccess file anyone has for the admin directory that I can test with the site?

  4. #4
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default Re: 403 Error only on configuration.php in Admin

    Code:
    #
    
    # @copyright Copyright 2003-2016 Zen Cart Development Team
    
    # @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    
    # @version $Id: .htaccess 19328 Modified in v1.6.0 $
    
    #
    
    # This is used with Apache WebServers
    
    #
    
    # The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
    
    # It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
    
    # Will also prevent people from seeing what is in the dir. and any sub-directories
    
    #
    
    # For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
    
    # Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified.
    
    # Example:
    
    #<Directory "/usr/local/apache/htdocs">
    
    #  AllowOverride Limit Options Indexes
    
    #</Directory>
    
    ###############################
    
    DirectoryIndex index.php
    
    <FilesMatch "^stamps\.php$">
    Allow From All
    </FilesMatch>
    
    # deny *everything*
    
    <FilesMatch ".*\..*">
    
      <IfModule mod_authz_core.c>
    
        Require all denied
    
      </IfModule>
    
      <IfModule !mod_authz_core.c>
    
        Order Allow,Deny
    
        Deny from all
    
      </IfModule>
    
    </FilesMatch>
    
    
    
    # allow access to the root
    
    <FilesMatch "^$">
    
      <IfModule mod_authz_core.c>
    
        Require all granted
    
      </IfModule>
    
      <IfModule !mod_authz_core.c>
    
        Order Allow,Deny
    
        Allow from all
    
      </IfModule>
    
    </FilesMatch>
    
    
    
    # but now allow just *certain* necessary files:
    
    <FilesMatch "(?i).*\.(php|js|css|html?|ico|otf|jpe?g|gif|webp|png|swf|flv|xml|xsl)$">
    
      <IfModule mod_authz_core.c>
    
        Require all granted
    
      </IfModule>
    
      <IfModule !mod_authz_core.c>
    
        Order Allow,Deny
    
        Allow from all
    
      </IfModule>
    
    </FilesMatch>
    
    
    
    IndexIgnore */*
    
    
    
    <limit POST PUT>
    
      <IfModule mod_authz_core.c>
    
        Require all denied
    
      </IfModule>
    
      <IfModule !mod_authz_core.c>
    
        Order Allow,Deny
    
        Deny from all
    
      </IfModule>
    
    </limit>
    
    
    
    
    
    ## NOTE: If you want even greater security to prevent hackers from running scripts in this folder, uncomment the following line (if your hosting company will allow you to use OPTIONS):
    
    # OPTIONS -Indexes -ExecCGI
    
    
    
    
    
    
    
    ##################
    
    ## Optional caching improvements
    
    ## Requires mod_header and mod_deflate to be enabled within Apache
    
    ##################
    
    <IfModule mod_headers.c>
    
      Header unset Pragma
    
      FileETag None
    
      Header unset ETag
    
      #Header set Cache-Control "no-transform"
    
      <FilesMatch "(?i).*\.(ico|jpe?g|gif|otf|webp|png|swf|flv|svg|svgz)$">
    
        Header set Cache-control "max-age=864000, public, must-revalidate"
    
        Header unset Last-Modified
    
      </FilesMatch>
    
      <FilesMatch "(?i).*\.(html|htm|xml|txt|xsl)$">
    
        Header set Cache-control "max-age=7200, must-revalidate"
    
      </FilesMatch>
    
    </IfModule>
    
    <IfModule mod_deflate.c>
    
      <FilesMatch "(?i)\.(js|css)$">
    
        SetOutputFilter DEFLATE
    
      </FilesMatch>
    
    </IfModule>
    
    
    
    ##################
    
    ## Optional improvements
    
    ## Requires mod_expires to be enabled within Apache
    
    ##################
    
    <ifmodule mod_expires.c>
    
      ExpiresActive On
    
      ExpiresDefault A300
    
      ExpiresByType application/x-javascript A3600
    
      ExpiresByType text/css A3600
    
      ExpiresByType image/gif A604800
    
      ExpiresByType video/x-flv A604800
    
      ExpiresByType application/pdf A604800
    
      ExpiresByType text/html A300
    
      ExpiresByType image/x-icon A86400
    
      ExpiresByType image/jpeg A2592000
    
      ExpiresByType image/png A2592000
    
      ExpiresByType text/cache-manifest "access plus 0 seconds"
    
    
    
    </ifmodule>
    
    
    
    
    
    #turn off X-PHP-Originating-Script header when sending emails from admin
    
    #uncomment to activate:
    
    # php_flag mail.add_x_header Off
    This is the current .htaccess settings for the admin directory. Is this denying php somehow? I'm not familiar with .htaccess well at all.

  5. #5
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: 403 Error only on configuration.php in Admin

    Quote Originally Posted by clam_man View Post
    I have reached out to them but now I'm wondering if it is a .htaccess issue. Is there a clean .htaccess file anyone has for the admin directory that I can test with the site?
    Every download of the zen cart software has a fresh, clean, unaltered version of every file that supports operation of that version...

    Check the main page of the forum, there is a link to get older versions. Of course, the other question is how did this version get installed? Isn't there a copy of the file in your original fileset used to upload the store?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: 403 Error only on configuration.php in Admin

    What about generated error log files in your logs folder? Don't you possibly have any myDEbug-adm logs? Not guaranteed for a 403, just asking...

    Nothing in the above posted copy specifically stops the configuration.php file especially if able to access other menu options. Now there is I think it was a possibility that the database server has been upgraded and now items in the configuration table are no longer as they should be to support the expected operation and so therefore coming across this issue... just guessing though in large part.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default Re: 403 Error only on configuration.php in Admin

    It happened after changing server hosts. I asked them about it but they won't go through the htaccess file to check it. I don't have any error logs. This htaccess file is the same as the one we used before with a different server host.

  8. #8
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: 403 Error only on configuration.php in Admin

    Quote Originally Posted by clam_man View Post
    It happened after changing server hosts. I asked them about it but they won't go through the htaccess file to check it. I don't have any error logs. This htaccess file is the same as the one we used before with a different server host.
    Sounds like possibly in the transition from one host to another that this file may have gotten "lost". A 403 is a file not found response. If the file is not present, then that sort of response will be given. Also, if the file is present but attempts to redirect to somewhere else, then that might cause the issue.

    What has been the method to attempt to get to configuration.php? Has it been by use of the navigation menu on screen or have you tried to manually type in the browser address?

    There could be something wrong with a component of the database direction for that menu. After logging in then in the browser's web address window if you replace say index.php with configuration.php (again, this is not replacing or moving files, we are just talking about a web address change.), do you still get the 403?

    Considering how long it has been since access was available, what configuration(s) are trying to change so that some direction may be given to update those specific items if they still need to be.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default Re: 403 Error only on configuration.php in Admin

    Quote Originally Posted by mc12345678 View Post
    this file may have gotten "lost". A 403 is a file not found response. If the file is not present, then that sort of response will be given.
    It says 403 Forbidden, not not-found.

    I can see the file as present when I FTP into the admin section, that's how I was able to make sure the permissions were correct. Using configuration.php in place of index.php in the admin section still throws the 403 Forbidden error. I did manually change some settings in the configuration table in the database so I was able to get it to do what I needed but I still would like to be able to access. I really appreciate you spending the time to help me out with this!

 

 

Similar Threads

  1. v154 403 error when trying to access admin
    By jenpen in forum General Questions
    Replies: 8
    Last Post: 30 May 2018, 06:46 AM
  2. v155 Forbidden 403 when accessed admin>linkpoint_review.php
    By oavs in forum General Questions
    Replies: 1
    Last Post: 9 May 2017, 01:11 PM
  3. v153 Images in admin dont show 403 Error
    By l3ackdraft in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 31 Jul 2014, 10:05 PM
  4. v150 403.1 Error Installing v1.5 using PHP 5.3.10 as FastCGI
    By psrussell in forum Installing on a Windows Server
    Replies: 6
    Last Post: 11 Feb 2012, 04:29 PM
  5. 403 Error Locked out of admin
    By Webskipper in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Dec 2007, 07:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR