getting a weird error when I try to build project on droplet

December 8, 2017 99 views
PHP Ubuntu 16.04

On my development environment I would usually run these commands to rebuild my project:

php artisan cache:clear
composer dump-autoload

but when I try running them on my droplet I get some weird errors:

PHP Fatal error:  Uncaught Error: Class 'Illuminate\Foundation\Application' not found in /var/www/dev.drmanansala.com/bootstrap/app.php:14
Stack trace:
#0 /var/www/dev.drmanansala.com/artisan(18): require_once()
#1 {main}
  thrown in /var/www/dev.drmanansala.com/bootstrap/app.php on line 14
Cannot create cache directory /home/francis/.cache/composer/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/francis/.cache/composer/files/, or directory is not writable. Proceeding without cache
Generating autoload files

Anyone have any idea's whats going on? Also, I can't seem to get gulp to work on my ubuntu machine. Says gulp is not a command

2 Answers

Your environment isn't configured correctly. You probably need to remove the contents of vendor/ from your version control and run composer install on your droplet.

  • Thanks for the response! I have my repo ignoring my vendor folder already. I tried doing composer install and running into some problems. I'm guessing the machine's php also needs to be updated? This is the message i get when trying to do composer install:

    Cannot create cache directory /home/francis/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
    Cannot create cache directory /home/francis/.composer/cache/files/, or directory is not writable. Proceeding without cache
    Loading composer repositories with package information
    Installing dependencies (including require-dev) from lock file
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Installation request for laravel/framework v5.3.31 -> satisfiable by laravel/framework[v5.3.31].
        - laravel/framework v5.3.31 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
      Problem 2
        - Installation request for phpunit/php-code-coverage 4.0.8 -> satisfiable by phpunit/php-code-coverage[4.0.8].
        - phpunit/php-code-coverage 4.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.
      Problem 3
        - Installation request for phpunit/phpunit 5.7.25 -> satisfiable by phpunit/phpunit[5.7.25].
        - phpunit/phpunit 5.7.25 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    
      To enable extensions, verify that they are enabled in those .ini files:
        - /etc/php/7.0/cli/php.ini
        - /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
        - /etc/php/7.0/cli/conf.d/10-opcache.ini
        - /etc/php/7.0/cli/conf.d/10-pdo.ini
        - /etc/php/7.0/cli/conf.d/20-calendar.ini
        - /etc/php/7.0/cli/conf.d/20-ctype.ini
        - /etc/php/7.0/cli/conf.d/20-exif.ini
        - /etc/php/7.0/cli/conf.d/20-fileinfo.ini
        - /etc/php/7.0/cli/conf.d/20-ftp.ini
        - /etc/php/7.0/cli/conf.d/20-gettext.ini
        - /etc/php/7.0/cli/conf.d/20-iconv.ini
        - /etc/php/7.0/cli/conf.d/20-json.ini
        - /etc/php/7.0/cli/conf.d/20-mysqli.ini
        - /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini
        - /etc/php/7.0/cli/conf.d/20-phar.ini
        - /etc/php/7.0/cli/conf.d/20-posix.ini
        - /etc/php/7.0/cli/conf.d/20-readline.ini
        - /etc/php/7.0/cli/conf.d/20-shmop.ini
        - /etc/php/7.0/cli/conf.d/20-sockets.ini
        - /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
        - /etc/php/7.0/cli/conf.d/20-sysvsem.ini
        - /etc/php/7.0/cli/conf.d/20-sysvshm.ini
        - /etc/php/7.0/cli/conf.d/20-tokenizer.ini
      You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
    

ran a few commands:

sudo apt-get install php-xml
sudo apt-get install php-mbstring

was able to get my composer install to work. Laravel is finally running but it's running into problems lol. I'm guessing it's a problem with the directories now

Have another answer? Share your knowledge.