Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kurtis's avatar

The use Statement error vs SSH Keys

Greeating, this is my first Laravel project. I created a github account today, pushed my source to it, and followed the laracast in creating a digital ocean server / site. I get the following error when I try to install respository. Suggests it might be SSH key related, but I can connect per the dashboard connection test, and, I checked to see that the keys are on the server. Meanwhile I get a 'use Request' after php artisan clear-compiled, but, I don't get file / line numbers to adequately debug.

So I can (and have tried a few) make changes in various files and re-test, but it would be good to know where to get more detailed logs, or tips on this ...

Installing classpreloader/classpreloader (1.4.0) Loading from cache

  • Installing laravel/framework (v5.0.32) Loading from cache

  • Installing illuminate/html (v5.0.0) Loading from cache

Generating autoload files

php artisan clear-compiled

[ErrorException]
The use statement with non-compound name 'Request' has no effect

Script php artisan clear-compiled handling the post-install-cmd event returned with an error

[RuntimeException]
Error Output:

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]

0 likes
2 replies
kurtis's avatar

I am adding the full error message now (minus IP addresses / keys), and, again, I am able to get a connection (via dashboard) and I have verified the keys, as required, exist. Would I get this error message at all if the conncetion test in the dashboard failed (maybe it only tests 1 aspect).

What concerns me is the actual error message, which is complaining about 'use statement with non-compound name'. I realize this is namespace issue, I've tested this on my dev server, replacing all 'use' of Request with just \Request where I need it (e.g. \Request::ajax) as something to try, updated my github, and repeatedly deleted and re-created server / site with repository pull. Anyway, here's the full error message (first laravel project :)


We had trouble connecting to your server. Typically, this means there is a problem with the SSH keys on the server. Or, your server may be prompting for a password when Forge attempts to SSH in as the root user.
Error Output
Cloning into '…'…
Warning: Permanently added the RSA host key for IP address '19...' to the list of known hosts.
Loading composer repositories with package information
Installing dependencies from lock file
  - Installing vlucas/phpdotenv (v1.1.1)
    Loading from cache

  - Installing symfony/var-dumper (v2.6.9)
    Loading from cache

  - Installing symfony/translation (v2.6.9)
    Loading from cache

  - Installing symfony/security-core (v2.6.9)
    Loading from cache

  - Installing symfony/routing (v2.6.9)
    Loading from cache

  - Installing symfony/process (v2.6.9)
    Loading from cache

  - Installing symfony/http-foundation (v2.6.9)
    Loading from cache

  - Installing symfony/event-dispatcher (v2.7.0)
    Loading from cache

  - Installing psr/log (1.0.0)
    Loading from cache

  - Installing symfony/debug (v2.6.9)
    Loading from cache

  - Installing symfony/http-kernel (v2.6.9)
    Loading from cache

  - Installing symfony/finder (v2.6.9)
    Loading from cache

  - Installing symfony/console (v2.6.9)
    Loading from cache

  - Installing swiftmailer/swiftmailer (v5.4.0)
    Loading from cache

  - Installing nikic/php-parser (v1.3.0)
    Loading from cache

  - Installing jakub-onderka/php-console-color (0.1)
    Loading from cache

  - Installing jakub-onderka/php-console-highlighter (v0.3.1)
    Loading from cache

  - Installing dnoegel/php-xdg-base-dir (0.1)
    Loading from cache

  - Installing psy/psysh (v0.4.4)
    Loading from cache

  - Installing nesbot/carbon (1.19.0)
    Loading from cache

  - Installing mtdowling/cron-expression (v1.0.4)
    Loading from cache

  - Installing monolog/monolog (1.13.1)
    Loading from cache

  - Installing league/flysystem (1.0.3)
    Loading from cache

  - Installing jeremeamia/superclosure (2.1.0)
    Loading from cache

  - Installing ircmaxell/password-compat (v1.0.4)
    Loading from cache

  - Installing doctrine/inflector (v1.0.1)
    Loading from cache

  - Installing danielstjules/stringy (1.9.0)
    Loading from cache

  - Installing symfony/filesystem (v2.7.0)
    Loading from cache

  - Installing classpreloader/classpreloader (1.4.0)
    Loading from cache

  - Installing laravel/framework (v5.0.32)
    Loading from cache

  - Installing illuminate/html (v5.0.0)
    Loading from cache

Generating autoload files
> php artisan clear-compiled


                                                                    
  [ErrorException]                                                  
  The use statement with non-compound name 'Request' has no effect  
                                                                    


Script php artisan clear-compiled handling the post-install-cmd event returned with an error


                      
  [RuntimeException]  
  Error Output:       
                      


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]


Couldn't Clone Repository?
Please make sure the following SSH key has been added as a "deploy key" to your source control provider account:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSgISvoF6lF4WDe3j8GlLX8y4cL/dZcYw...
Couldn't SSH Into Server?
Please make sure that the following SSH key is placed in both the/home/forge/.ssh/authorized_keys file and the /root/.ssh/authorized_keys file on your server.
ssh-rsa AAAAB3Nz….rsYz...== phpseclib-generated-key
You can test your server connection status on the Forge Dashboard, which contains a list of all of your servers. To test your server connection status, click the  icon in the "Connection" column.

kurtis's avatar
kurtis
OP
Best Answer
Level 2

OK it was indeed a use Request line that I didn't need in routes.php, a more thorough search found that. This wasn't an issue on my dev machine. One thing, the error messages pre/post the error output had me chasing SSH issues, when, there were none, so pay more attention to the actual error message. You can trust the dashboard connection test. Having a line output for which file had the issue would have helped also, perhaps this is a log setting I missed, but since Forge is doing it all, that wasn't obvious. Now I can move on completing the next steps.

Please or to participate in this conversation.