We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30176
    • 99 Posts
    I had a topic elsewhere but was instructed to write here in the IIS group.

    I have a head scratcher. huh I have used an includeFile snippet to call my template. After working fine on my development machine I transfered the site to the hosts server and it throws a file not found error on the template.
    the proper snippet and one I used is
    [[includeFile? &file=`template/AndreasModx/template.andreas00.3col.html`]]


    However if I change the snippet call (which would be incorrect) by adding ../ so the snippet looks like:
    [[includeFile? &file=`../template/AndreasModx/template.andreas00.3col.html`]]


    As expected I get the following error:
    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: include(../template/AndreasModx/template.andreas00.3col.html) [function.include]: failed to open stream: No such file or directory
    Error type/ Nr.: Warning - 2
    File: D:\inetpub\vhosts\mydomain.com\httpdocs\manager\includes\document.parser.class.inc.php(770) : eval()’d code
    Line: 7

    But, after logging into the Manager the includeFile snippet works fine for a number of hours until there is no activity on the server for a while (such as overnight) and then it will throw the error again. Log into the manager and the process starts over.

    I now questioned in my mind my hosts server. So I mirrored the installation into a Modx subdirectory, and there everything works fine with the proper includeFile call.

    This is baffling to me and any thoughts on why this might be occurring
    1. in the root as opposed to the subdirectory.
    2. the incorrect call works after logging into the manager

    would be helpful.

    I can use an absolute path or put the template in the database (which both do work),however, the fact remains that something is broken and probably means many things will not work that need proper path structures.

    Thank you.

      "Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
      -J.R.R. Tolkien from The Lord of the Rings
      • 30176
      • 99 Posts
      And here is a quick follow-up to the previous post.

      In Elements => Manage Files it returns


      Invalid path "D:/inetpub/vhosts/mydomain.com/httpdocs/"
      Filename Modified File size Options
      This directory is empty.
      Directories: 0
      Files: 0
      Data: 0 B
      Directory writable? No.

      That path is what is in File Manager Path settings and [(filemanager_path)] placed on a page returns the same path.

      Now this is where it gets interesting, if I switch my Server from FastCGI to CGI the above problem goes away and files appear properly in Manage Files. Also my includeFile snippet calls on the template file appears properly (mentioned in the previous post). However, the downside is that it breaks the Reflect Snippet that was working previously, but this occurs only when logged out of the Manager. Logged into the Manager and everything works fine.

      And I do have Base Site_url in the template and I did run the installer again.



        "Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
        -J.R.R. Tolkien from The Lord of the Rings
        • 30176
        • 99 Posts
        I have the default install with the sample data on Evo 1.02. I need some help by someone who understands Modx better than I.

        Simply, Running under CGI and everything works fine, Switch to FastCGI and things break with no changes to the site and using the default install.

        Running under FastCGI

        1. Pages do not cache

        2. The Blog link returns the error:
        « MODx Parse Error »
        MODx encountered the following error while attempting to parse the requested resource:
        « PHP Parse Error »

        PHP error debug
        Error: require_once(manager/includes/sniff/phpSniff.core.php) [function.require-once]: failed to open stream: No such file or directory
        Error type/ Nr.: Warning - 2
        File: D:\inetpub\vhosts\mydomain.com\httpdocs\manager\includes\sniff\phpSniff.class.php
        Line: 22
        Line 22 source: require_once($modx->config[’base_path’] . ’manager/includes/sniff/phpSniff.core.php’);


        3. In Elements => Manage Files it returns
        Invalid path "D:/inetpub/vhosts/mydomain.com/httpdocs/"
        Filename Modified File size Options
        This directory is empty.
        Directories: 0
        Files: 0
        Data: 0 B
        Directory writable? No.


        To check if FastCGI is up and running I checked phpinfo.php//foobar/?foo=bar and it returned
        _SERVER["REQUEST_URI"] /info.php/foobar/?foo=bar

        So I think that assures that FastCGI is working properly on the server.

        Under FastCGI the backend runs noticeably faster.

          "Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
          -J.R.R. Tolkien from The Lord of the Rings
          • 37550 ☆ A M B ☆
          • 711 Posts
          What are your path settings in MODx Configuration? on our servers which run FastCGI we have for example

          D:/Domains/onesmarthost.co.uk/wwwroot/

          Also have you verified that the paths are correct?

          Could you also tell me a little more about your setup environment:

          OS Version
          IIS Version
          PHP Version

          Thanks Aaron



            http://www.onesmarthost.co.uk
            UK MODX Hosting with love.
            • 30176
            • 99 Posts
            Hi Aaron, Thanks for responding

            I think that the paths are correct (and I did not change anything on the database from switching back and forth from CGI to FastCGI, where CGI works ok)

            File Manager path - D:/inetpub/vhosts/mydomain.com/httpdocs/
            File base path - D:/inetpub/vhosts/mydomain.com/httpdocs/assets/
            File Browser URL - http://www.mydomain.com/assets/


            Windows 2003/2008 (I am on a Plesk 8.6 Panel)
            IIS Version 6
            PHP Version 5.2.6

            I made sure the database collations were correct. I am using utf8_general_ci (need some extra characters)

              "Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
              -J.R.R. Tolkien from The Lord of the Rings
              • 37550 ☆ A M B ☆
              • 711 Posts
              Thanks for the info on your original post did you edit the error messages before you posted?

              Because the paths shown do not match up

              If you could either post the exact error messages or send me a Direct Message that would be great.

              Also check your _SERVER["PATH_TRANSLATED"] in phpinfo(); page.

              Thanks Aaron
                http://www.onesmarthost.co.uk
                UK MODX Hosting with love.
                • 30176
                • 99 Posts
                Hi Aaron,

                I missed that as I did not really want to publish the domain I was on.

                The info for: _SERVER["PATH_TRANSLATED"] D:\inetpub\vhosts\mydomain.com\httpdocs\info.php

                I checked and the error again is:
                « MODx Parse Error »
                MODx encountered the following error while attempting to parse the requested resource:
                « PHP Parse Error »

                PHP error debug
                Error: require_once(manager/includes/sniff/phpSniff.core.php) [function.require-once]: failed to open stream: No such file or directory
                Error type/ Nr.: Warning - 2
                File: D:\inetpub\vhosts\mydomain.com\httpdocs\manager\includes\sniff\phpSniff.class.php
                Line: 22
                Line 22 source: require_once($modx->config[’base_path’] . ’manager/includes/sniff/phpSniff.core.php’);


                One tidbit: I can stop the blog error if I go into phpsniff.class.php and edit
                require_once($modx->config['base_path'] . 'manager/includes/sniff/phpSniff.core.php');

                to
                require_once('phpSniff.core.php');


                However, the problems with cache and files persist in Elements => Manage Files
                  "Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
                  -J.R.R. Tolkien from The Lord of the Rings
                  • 37550 ☆ A M B ☆
                  • 711 Posts
                  It’s a strange one, can you ping me on skype or MSN

                  Skype: awardle
                  MSN: [email protected]

                  Thanks
                    http://www.onesmarthost.co.uk
                    UK MODX Hosting with love.
                    • 37550 ☆ A M B ☆
                    • 711 Posts
                    Just had a chat with Thomas and its looking like php fastcgi does not have modify permissions to the files on the web server.

                    As a test we created a simple php page which tried to create a new file on the server and this failed with permission denied.

                    Thomas is going to contact his web host to have them set the IUSR_DomainName Account Modify rights to the httpdocs and all sub directories and files this is what PHP FastCGI Runs under on a windows server.

                    Fingers crossed we should hear some good news from Thomas smiley

                    Aaron
                      http://www.onesmarthost.co.uk
                      UK MODX Hosting with love.
                      • 30176
                      • 99 Posts
                      I am finding that Modx Core and FastCGI on a Plesk Panel do not play nicely together at the root.

                      After some searching and sackcloth and ashes, on the Parallels (Plesk) forum there is information about a bug.
                      "We’re running into a permissions issue, however - PHP has the ability to overwrite existing files, but not create new files."
                      This is the same issues that I am finding. Breaking a number of pages that need to be able to create a file on the Session root. It will create files in sub directories fine but at the root will not. In my setup, I was trying to get it going on the root, after getting familiar with Modx Evo in a subdirectory.
                      See: http://forum.parallels.com/showthread.php?t=81945&highlight=fastcgi

                      In my case: Php 5.2.6 MySql 5.0.45
                      1. The Modx Evo installation will run in a Subdirectory in CGI or FastCGI
                      2. The installation will run at the Root in CGI but a number of things break in FastCGI

                      In addition, in my environment testing web page load time, running in CGI on PHP 5.2.6 runs terribly slow. Pages that load in FastCGI at .5 seconds, in CGI load on average 5.5 seconds. >10X Or stated more dramatically, 10 pages in 5 seconds verses 10 pages in 55 seconds.

                      One other point, moving back to php 4.4.7 in CGI and the pages load faster.

                      I did work with Aaron on permissions, and he was extremely generous with his time. I did what he suggested, however, the fact the installation works under CGI but not FastCGI at the root points to something beyond permissions, I think. Though this is getting a bit beyond me.

                      I hope this helps some other people in the same environment from pounding their head against a wall.

                        "Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
                        -J.R.R. Tolkien from The Lord of the Rings