{
    "url": "https://delaparra-services.nl/manuals/php-en-composer",
    "locale": "en",
    "title": "PHP and Composer · DeLaParra Services",
    "description": "Install PHP and Composer using php.new or your Linux package manager, and run a Laravel app locally.",
    "alternates": {
        "en": "https://delaparra-services.nl/manuals/php-en-composer",
        "nl": "https://delaparra-services.nl/nl/handleidingen/php-en-composer"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/manuals/php-en-composer.csv",
        "md": "https://delaparra-services.nl/manuals/php-en-composer.md",
        "json": "https://delaparra-services.nl/manuals/php-en-composer.json",
        "zip": "https://delaparra-services.nl/manuals/php-en-composer.zip",
        "pdf": "https://delaparra-services.nl/manuals/php-en-composer.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/manuals/php-en-composer.csv",
            "encodingFormat": "text/csv",
            "name": "php-en-composer.csv"
        },
        {
            "url": "https://delaparra-services.nl/manuals/php-en-composer.json",
            "encodingFormat": "application/json",
            "name": "php-en-composer.json"
        },
        {
            "url": "https://delaparra-services.nl/manuals/php-en-composer.md",
            "encodingFormat": "text/markdown",
            "name": "php-en-composer.md"
        },
        {
            "url": "https://delaparra-services.nl/manuals/php-en-composer.pdf",
            "encodingFormat": "application/pdf",
            "name": "php-en-composer.pdf"
        },
        {
            "url": "https://delaparra-services.nl/manuals/php-en-composer.zip",
            "encodingFormat": "application/zip",
            "name": "php-en-composer.zip"
        }
    ],
    "markdown": "Install PHP and Composer using php.new or your Linux package manager, and run a Laravel app locally.\n\n## WHAT IT IS | The language of your web app.\n\nPHP runs on the server and generates the pages of your website. Laravel, the framework I use to build apps, is written in PHP. You use **Composer** to install a project’s PHP packages.\n\nThe easiest way to install everything in one go is to use `php.new`. This is the method recommended by Laravel itself. It installs PHP, Composer and the Laravel installer.\n\n### 01 / Windows\n\nOpen PowerShell **as an administrator** (right-click on PowerShell, **Run as administrator**) and run the following:\n\n```\nSet-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://php.new/install/windows/8.4'))\n```\n\nClose PowerShell and open it again.\n\n### 02 / Linux\n\n```\n/bin/bash -c \"$(curl -fsSL https://php.new/install/linux/8.4)\"\n```\n\nClose the terminal and open it again.\n\nIt’s best to copy the command from laravel.com/docs/installation. That site always lists the latest PHP version.\n\n### 03 / Checking\n\n```\nphp --version\ncomposer --version\n```\n\n## WITHOUT PHP.NEW | Linux packages.\n\nWould you prefer to use Linux’s own package manager? That’s an option too.\n\n### 04 / Ubuntu / Debian / Linux Mint\n\n```\nsudo apt update\nsudo apt install php-cli php-mbstring php-xml php-curl php-zip php-sqlite3 unzip composer\n```\n\n### 05 / Fedora\n\n```\nsudo dnf install php-cli php-mbstring php-xml php-pdo composer\n```\n\n### 06 / Arch Linux\n\n```\nsudo pacman -S php composer\n```\n\nNext, use `php --version` to check which version you have. If it’s older than what your project requires, use php.new.\n\n## A PROJECT | Getting started with your Laravel app.\n\n### 07 / Installing packages\n\nOpen the terminal in your project folder:\n\n```\ncomposer install\n```\n\nComposer creates a `vendor` folder. This should not be included in Git.\n\n### 08 / The configuration file\n\nCopy the example file and create a key:\n\n**Windows**\n```\ncopy .env.example .env\nphp artisan key:generate\n```\n\n**Linux**\n```\ncp .env.example .env\nphp artisan key:generate\n```\n\n### 09 / Launching the app\n\n```\nphp artisan serve\n```\n\nOpen http://127.0.0.1:8000 in your browser. To stop it, press **Ctrl + C**.\n\nDoes the project also use Node.js? If so, open a second terminal and run `npm install` and `npm run dev`. See the Node.js and JavaScript manuals.\n\n## WORKING WITH AI | Ask your assistant.\n\n### 10 / A task for your AI assistant\n\n\"Check that PHP and Composer are running the versions specified in composer.json, install the packages and run the app locally. Do not carry out any migrations on a database that is not local, and ask for permission before installing anything.\"\n\n**Good to know**\nThe `.env` file contains passwords and keys. Never commit it to Git, and do not send it via email or chat. `.env.example` may be committed to Git, provided it does not contain any real data.\n\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "TechArticle",
                "@id": "https://delaparra-services.nl/manuals/php-en-composer#article",
                "url": "https://delaparra-services.nl/manuals/php-en-composer",
                "headline": "PHP and Composer",
                "description": "Install PHP and Composer using php.new or your Linux package manager, and run a Laravel app locally.",
                "inLanguage": "en",
                "subjectOf": {
                    "@id": "https://delaparra-services.nl/manuals/php-en-composer#dataset"
                }
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/manuals/php-en-composer#dataset",
                "name": "PHP and Composer",
                "description": "Install PHP and Composer using php.new or your Linux package manager, and run a Laravel app locally.",
                "url": "https://delaparra-services.nl/manuals/php-en-composer",
                "identifier": "https://delaparra-services.nl/manuals/php-en-composer#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/manuals/php-en-composer#article"
                },
                "publisher": {
                    "@type": "Organization",
                    "name": "DeLaParra Services",
                    "url": "https://delaparra-services.nl/"
                },
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/manuals#dataset",
                    "name": "Manuals for working on your own app",
                    "url": "https://delaparra-services.nl/manuals"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "php-en-composer.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/manuals/php-en-composer.csv",
                        "inLanguage": "en"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "php-en-composer.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/manuals/php-en-composer.json",
                        "inLanguage": "en"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "php-en-composer.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/manuals/php-en-composer.md",
                        "inLanguage": "en"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "php-en-composer.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/manuals/php-en-composer.pdf",
                        "inLanguage": "en"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "php-en-composer.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/manuals/php-en-composer.zip",
                        "inLanguage": "en"
                    }
                ]
            }
        ]
    }
}