0

I'm new to Laravel and I have pulled one project from a git repo. .gitIgnore file contains:

/vendor
/.idea
Homestead.json
Homestead.yaml
.env

And I see that my project is not working. This is actually a back-end, using a Lumen and the route which is set, is not accessible via localhost:8080/myRouteName even that it's set

$router->group(['prefix' => 'myRouteName'], function () use ($router) {
    $router->post('/', ['middleware' => 'auth', 'uses' => 'MyController@store']);
});

So I guess that I will need the /vendor folder, since I guess it's required for the app to run properly. I navigated in the project directory and run the command: composer install and I ended up with this error:

PS C:\wamp64\www\myprojectname> composer install
  [Composer\Exception\NoSslException]
  The openssl extension is required for SSL/TLS protection but is not available. 
If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true.
    install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

I then opened my WAMP directory and was not able to found the php.ini (php7.3.1 and this is set in my windows user environment variables) since I only see php-development.ini and php-production.ini.

So I ended up with the command:

composer config -g -- disable-tls true

and then by running composer install again I got these errors:

PS C:\wamp64\www\myprojectname> composer install
You are running Composer with SSL/TLS protection disabled.
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 illuminate/encryption v5.6.15 -> satisfiable by illuminate/encryption[v5.6.15].
    - illuminate/encryption v5.6.15 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 2
    - Installation request for illuminate/support v5.6.15 -> satisfiable by illuminate/support[v5.6.15].
    - illuminate/support v5.6.15 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 3
    - Installation request for mongodb/mongodb 1.3.1 -> satisfiable by mongodb/mongodb[1.3.1].
    - mongodb/mongodb 1.3.1 requires ext-mongodb ^1.4.0 -> the requested PHP extension mongodb is missing from your system.
  Problem 4
    - Installation request for phpunit/phpunit 7.0.3 -> satisfiable by phpunit/phpunit[7.0.3].
    - phpunit/phpunit 7.0.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 5
    - illuminate/support v5.6.15 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/lumen-framework v5.6.3 requires illuminate/support 5.6.* -> satisfiable by illuminate/support[v5.6.15].
    - Installation request for laravel/lumen-framework v5.6.3 -> satisfiable by laravel/lumen-framework[v5.6.3].

Tried to uncomment (in both php-development.ini and php-production.ini) things like:

extension=openssl
extension=mbstring

but this is not helping with the errors. My composer.json file looks like:

{
    "name": "laravel/lumen",
    "description": "The Laravel Lumen Framework.",
    "keywords": ["framework", "laravel", "lumen"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=7.1.3",
        "google/apiclient": "^2.0",
        "jenssegers/mongodb": "^3.4",
        "laravel/lumen-framework": "5.6.*",
        "league/fractal": "^0.17.0",
        "vlucas/phpdotenv": "~2.2"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "phpunit/phpunit": "~7.0",
        "mockery/mockery": "~1.0"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/",
            "database/"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

So basically I'm not sure how to set up one basic Laravel/Lumen application pulled from a git repo.

delux
  • 1,694
  • 10
  • 33
  • 64
  • php-development.ini and php-production.ini files are not being loaded when WAMP loads, that's why uncommenting the lines in either of those files did not work. Apply the changes to the appropriate path outlined in [this](https://stackoverflow.com/questions/24262606/edit-php-ini-file) post. Then restart WAMP and see what happens. You may need to rerun 'composer config -g -- disable-tls true'. – Michael Miller Feb 05 '19 at 03:25

1 Answers1

0

Lumen requires the following PHP extensions to be enabled in your PHP ini file.

OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension

(https://lumen.laravel.com/docs/5.7)

In order to edit the right php.ini file using WAMP you have to rightclick on the wamp icon in your taskbar, go to PHP and click php.ini.

In this file you should uncomment these two extensions.

extension=openssl
extension=mbstring
SuperDicq
  • 46
  • 3