dtzh131555 2017-03-10 12:28
浏览 71

PHP版本不一样

I had a problem with this code

class Crop
{
    const TYPE = ['main_crop', 'detail_crop', 'common_crop', 'list_crop'];
}

var_dump(Crop::TYPE);

Problem was that my PHP version was below 5.6 I managed to fix it by upgrading it.

So php -i is giving me PHP Version => 7.0.16-4+deb.sury.org~trusty+1.

Now I have a server running. Using phpinfo() I am getting back PHP Version 5.5.9-1ubuntu4.21, and because of it my code from above is not working.

I am using Laravel and using commands composer upgrade, composer install are not installing new php version. It doesn't matter what version I put in "php":"xxx".

composer.json :

{
    "name": "laravel/lumen",
    "description": "The Laravel Lumen Framework.",
    "keywords": ["framework", "laravel", "lumen"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.0",
        "laravel/lumen-framework": "5.2.*",
        "vlucas/phpdotenv": "~2.2",
        "venturecraft/revisionable": "^1.27",
         "doctrine/dbal": "^2.5",
        "nicolaslopezj/searchable": "^1.9",
        "sofa/eloquence": "^5.2",
        "intervention/image": "^2.3",
        "ivanlemeshev/laravel5-cyrillic-slug": "^1.0",
        "guzzlehttp/guzzle": "~6.0",
        "sngrl/sphinxsearch": "dev-master",
        "graylog2/gelf-php": "^1.5"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "phpunit/phpunit": "~4.0"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "files": [
            "app/Helpers/Helper.php"
        ]
    },
    "autoload-dev": {
        "classmap": [
            "tests/",
            "database/"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ]
    }
}

What am I doing wrong?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line