We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!

Answered Vapor Errors

    • 40735
    • 119 Posts
    Hi!
    I'm trying to import a Revo site from a local VM to Cloud. I followed the instructions found at https://modxcloud.com/userguide/how-tos/import-sites-with-vapor.html?ref=welcome-email but I'm getting the follow errors:
    /var/www/html/vapor/
    root@localhost:[branch [master]]-> ./vapor.php
    -bash: ./vapor.php: Permission denied
    
    /var/www/html/vapor/
    root@localhost:[branch [master]]-> ls -la
    total 36
    drwxr-xr-x.  2 root   root    4096 Dec 13 16:00 .
    drwxr-xr-x. 11 apache apache  4096 Dec 13 16:00 ..
    -rw-r--r--.  1 root   root   25030 Oct 30 16:03 vapor.php
    
    /var/www/html/vapor/
    root@localhost:[branch [master]]-> chmod 777 vapor.php
    
    /var/www/html/vapor/
    root@localhost:[branch [master]]-> ./vapor.php
    ./vapor.php: line 1: ?php: No such file or directory
    ./vapor.php: line 2: /bin: is a directory
    ./vapor.php: line 3: vapor.php: command not found
    ./vapor.php: line 4: vapor.php: command not found
    ./vapor.php: line 5: vapor.php: command not found
    ./vapor.php: line 6: vapor.php: command not found
    ./vapor.php: line 7: vapor.php: command not found
    ./vapor.php: line 7: you: command not found
    ./vapor.php: line 8: vapor.php: command not found
    ./vapor.php: line 9: syntax error near unexpected token `('
    ./vapor.php: line 9: ` * Foundation; either version 2 of the License, or (at your option) any later'

    What am I doing wrong?
    Thanks!

    This question has been answered by dwillis210. See the first response.

      • 40735
      • 119 Posts
      I tried it from a web browser and it seems to have worked. It seems like the PHP parser never got involved from the command line. I've successfully created a snapshot, imported into Vault and injected it into a dev cloud. I get a 500 error now if I browse to the site. My local VM is running Revo 2.2.4 but the cloud I created is on 2.2.6. Could this be why? [ed. note: dwillis210 last edited this post 11 years, 3 months ago.]
        • 40735
        • 119 Posts
        I destroyed the cloud and created a new one from the snapshot that I imported, this time running 2.2.4, but no dice. I still get a 500 error.
        • discuss.answer
          • 40735
          • 119 Posts
          It turns out that a snippet I wrote depended on a library that did not make it to Cloud during was being referenced with an absolute path that changed after the import process and this was causing the 500 error. [ed. note: dwillis210 last edited this post 11 years, 3 months ago.]
          • Quote from: dwillis210 at Dec 18, 2012, 03:50 PM
            It turns out that a snippet I wrote depended on a library that did not make it to Cloud during the import process and this was causing the 500 error.
            Can you share what library this was and where it was located in your environment? Just would like to know more about it.
              • 40735
              • 119 Posts
              Quote from: opengeek at Dec 18, 2012, 03:53 PM
              Quote from: dwillis210 at Dec 18, 2012, 03:50 PM
              It turns out that a snippet I wrote depended on a library that did not make it to Cloud during the import process and this was causing the 500 error.
              Can you share what library this was and where it was located in your environment? Just would like to know more about it.

              Sure. It was the phpFlickr library (http://phpflickr.com/) and I had placed it under assets/templates/ttuv3/phpFlickr-3.1/. I just opened an SSH connection to look at the file system and it appears that the library did actually make it to Cloud. I referenced the absolute path in my snippet and that path obviously changed when I imported the site to Cloud. Is there a way to reference a relative path? I'm using an include statement and I tried adding MODX_ASSETS_URL to it like I do with my regClientCSS/JS method calls but it gave me errors so I used the absolute path instead.
              • You can always use the MODX settings. Usually, I would do something like this:
                $path = $modx->getOption('assets_path', $scriptProperties, MODX_ASSETS_PATH);
                require_once $path . 'templates/ttuv3/phpFlickr-3.1/app.php';
                  • 40735
                  • 119 Posts
                  Sweet! That worked perfectly. So what's the difference between MODX_ASSETS_PATH and MODX_ASSETS_URL? The latter works fine with this:
                  $modx->regClientCSS(MODX_ASSETS_URL."templates/ttuv3/css/flickrousel.css");
                  But it does not work with this:
                  include(MODX_ASSETS_URL."templates/ttuv3/phpFlickr-3.1/phpFlickr.php");
                  • The "path" settings and constants represent absolute physical file paths on the computer. The "url" settings and constants represent the path used by the web server (i.e. based on the document root) for the corresponding "path" setting/constant.
                      • 40735
                      • 119 Posts
                      Quote from: opengeek at Dec 19, 2012, 05:31 PM
                      The "path" settings and constants represent absolute physical file paths on the computer. The "url" settings and constants represent the path used by the web server (i.e. based on the document root) for the corresponding "path" setting/constant.
                      That makes perfect sense now that you've said it. lol

                      Must MODX_ASSETS_PATH be used in conjunction with the getOption() method the way you did in your example or can it be used anywhere like I did with MODX_ASSETS_URL? Also, is there a list of these constants somewhere?
                      Thank you very much for answering my questions!