We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24951
    • 21 Posts
    A friend asked me to duplicate a MODx site and add it to root/english to start an English version. The content of the database has been copied to a new database, all files copied to root/english, configuration file changed, .htaccess rewrite rule changed to /english instead of /. But I am getting this PHP parse error now:
    « MODx Parse Error »
      Error: 	DocumentParser::include(/home/xxx/xxx/www/english/assets/cache/sitePublishing.idx.php) [documentparser.include]: failed to open stream: No such file or directory	 
      Error type/ Nr.: 	Warning - 2	 
      File: 	/home/xxx/xxx/www/english/manager/includes/document.parser.class.inc.php	 
      Line: 	525	 
      Line 525 source: 	@include $this->config["base_path"] . "assets/cache/sitePublishing.idx.php"; 	 
     


    I am a newbie to MODx and thought it was just a file permission issue and CHMOD 777 all files in assets/cache. Did not work. I went into the database and the system_settings table and added english to rb_base_url and rb_base_dir and file_manager_path. I edited the path in manager/includes/document.parser.class.inc.php on line 525. It did not work. I keep getting this error and a blank page when I go to the manager???
    Any idea what I am doing wrong here AND what I am supposed to do to fix this?
      • 24951
      • 21 Posts
      Where is base_path set? Maybe that’s the whole problem and all my additions of english to paths aren’t necessary...
        • 26903
        • 1,336 Posts
        Its set in your config.inc.php file under /manager/includes, it should be set automatically from the directory name of where the manager is, your error
        Error: DocumentParser::include(/home/xxx/xxx/www/english/assets/cache/sitePublishing.idx.php) [documentparser.include]: failed to open stream: No such file or directory
        seems to be saying that the /english/ subdir has been picked up but it still cant find the sitePublishing.idx file, check this for existence and perms.
          Use MODx, or the cat gets it!
          • 24951
          • 21 Posts
          Well the files exist. What do you mean by perms?
            • 24951
            • 21 Posts
            Well undid the database changes as MODx should pick those up. I did keep the .htaccess change for frienldy urls to /english. Error still remain and are the same as before unfortunately. Does document.parser.class.inc.php have to be edited when you move a modx site to another folder?
              • 26903
              • 1,336 Posts
              ’perms’ just means permissions, you say you’ve already chmod’ed the files in cache dir to 777 Ok, you also need to check the read/enter perms down this tree, ie the new ’english’ directory needs the correct perms on it as well as the cache directory, it should be r-x for others so apache can enter it for instance.
                Use MODx, or the cat gets it!
                • 24951
                • 21 Posts
                The folder cache/ and its files have all been chmod 777, folders english, manager/assets/flash, assets/images, assets/flash are chmod 777 as well. The path to /domain_name/www/english/assets/cache is CHMOD 777 all the way. What other folders need this as well?

                Error report:
                PHP error debug
                  Error: 	DocumentParser::include(/home/user/domain_name/www/english/assets/cache/sitePublishing.idx.php) [documentparser.include]: failed to open stream: No such file or directory	 
                  Error type/ Nr.: 	Warning - 2	 
                  File: 	/home/user/domain_name/www/english/manager/includes/document.parser.class.inc.php	 
                  Line: 	525	 
                  Line 525 source: 	@include $this->config["base_path"] . "assets/cache/sitePublishing.idx.php"; 
                  • 26903
                  • 1,336 Posts
                  OK does the above include the /assets folder itself? I’m not sure what /manager/assets/flash is.
                    Use MODx, or the cat gets it!
                    • 24951
                    • 21 Posts
                    Sorry, typo. /domain_name/www/english/assets assets is 777
                    Found one error. The file was looking for sitePublishing.idx.php not sitepublishing.idx.php. God knows why... I changed the lower case p into a cap P. Now I get this error:
                    PHP error debug
                      Error: 	Invalid argument supplied for foreach()	 
                      Error type/ Nr.: 	Warning - 2	 
                      File: 	/home/user/domain_name/www/english/manager/includes/document.parser.class.inc.php	 
                      Line: 	877	 
                      Line 877 source: 	foreach ($this->aliasListing as $item) { 


                    That seems to be on the url rewrite rule. Here is my .htaccess:
                    # MODx supports Friendly URLs via this .htaccess file. You must serve web
                    # pages via Apache with mod_rewrite to use this functionality, and you must
                    # change the file name from ht.access to .htaccess.
                    #
                    # Make sure RewriteBase points to the directory where you installed MODx.
                    # E.g., "/modx" if your installation is in a "modx" subdirectory. If you have
                    # problems with your .htaccess working at all, try un-commenting the first 
                    # line above the "RewriteEngine On" directive.
                    #
                    # You may choose to make your URLs non-case-sensitive by adding a NC directive
                    # to your rule: RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
                    
                    #Options +FollowSymlinks
                    RewriteEngine On
                    RewriteBase /english
                    
                    
                    
                    # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
                    #RewriteCond %{HTTP_HOST} .
                    #RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC]
                    #RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L]
                    #
                    # or for the opposite domain.com -> www.domain.com use the following
                    # >>> DO NOT USE BOTH THE ABOVE AND BELOW <<<
                    #
                    #RewriteCond %{HTTP_HOST} .
                    #RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC]
                    #RewriteRule (.*) http://www.example-domain-please-change.com/$1 [R=301,L]
                    
                    
                    
                    # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
                    # https://www.domain.com when your cert only allows https://secure.domain.com
                    #RewriteCond %{SERVER_PORT} !^443
                    #RewriteRule (.*) https://example-domain-please-change.com.com/$1 [R=301,L]
                    
                    
                    
                    # The Friendly URLs part
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                    
                    
                    
                    # Make sure .htc files are served with the proper MIME type, which is critical # for XP SP2. Un-comment if your host allows htaccess MIME type overrides.
                    
                    #AddType text/x-component .htc
                    
                    
                    
                    # If your server is not already configured as such, the following directive
                    # should be uncommented in order to set PHP's register_globals option to OFF.
                    # This closes a major security hole that is abused by most XSS (cross-site
                    # scripting) attacks. For more information: http://php.net/register_globals
                    #
                    # To verify that this option has been set to OFF, open the Manager and choose
                    # Reports -> System Info and then click the phpinfo() link. Do a Find on Page
                    # for "register_globals". The Local Value should be OFF. If the Master Value
                    # is OFF then you do not need this directive here.
                    #
                    # IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
                    #
                    # Your server does not allow PHP directives to be set via .htaccess. In that
                    # case you must make this change in your php.ini file instead. If you are
                    # using a commercial web host, contact the administrators for assistance in
                    # doing this. Not all servers allow local php.ini files, and they should
                    # include all PHP configurations (not just this one), or you will effectively
                    # reset everything to PHP defaults. Consult www.php.net for more detailed
                    # information about setting PHP directives.
                    
                    php_flag register_globals Off
                    
                    
                    
                    # For servers that support output compression, you should pick up a bit of
                    # speed but un-commenting the following lines.
                    
                    #php_flag zlib.output_compression On
                    #php_value zlib.output_compression_level 5
                    
                    
                    
                    # The following directives stop screen flicker in IE on CSS rollovers. If
                    # needed, un-comment the following rules. When they're in place, you may have
                    # to do a force-refresh in order to see changes in your designs.
                    
                    #ExpiresActive On
                    #ExpiresByType image/gif A2592000
                    #ExpiresByType image/jpeg A2592000
                    #ExpiresByType image/png A2592000
                    #BrowserMatch "MSIE" brokenvary=1
                    #BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
                    #BrowserMatch "Opera" !brokenvary
                    #SetEnvIf brokenvary 1 force-no-vary
                      • 26903
                      • 1,336 Posts
                      Ok, the aliasListing is defined in your siteCache.idx.php, its an array of id’s to alias mappings, it looks as though your mapping is non-existant. You may have to clear your cache then re-run the installer in upgrade mode to regenerate it because you have inserted the /english path. Check your iteCache.idx.php first, it should contain your aliases.
                        Use MODx, or the cat gets it!