{"id":15022926,"url":"https://github.com/rapidwebltd/php-switch-scripts","last_synced_at":"2025-04-09T19:51:12.916Z","repository":{"id":23562769,"uuid":"99335636","full_name":"rapidwebltd/php-switch-scripts","owner":"rapidwebltd","description":"🔄 Scripts to aid in the setup of and switching between multiple PHP versions in Ubuntu 14.04 LTS or newer","archived":false,"fork":false,"pushed_at":"2024-03-05T11:02:33.000Z","size":58,"stargazers_count":69,"open_issues_count":3,"forks_count":51,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-23T21:45:56.474Z","etag":null,"topics":["development-tools","php","php-versions","php5","php7"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rapidwebltd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-04T11:14:32.000Z","updated_at":"2024-07-30T14:12:41.000Z","dependencies_parsed_at":"2025-02-21T23:45:51.693Z","dependency_job_id":null,"html_url":"https://github.com/rapidwebltd/php-switch-scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapidwebltd%2Fphp-switch-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapidwebltd%2Fphp-switch-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapidwebltd%2Fphp-switch-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapidwebltd%2Fphp-switch-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rapidwebltd","download_url":"https://codeload.github.com/rapidwebltd/php-switch-scripts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103907,"owners_count":21048244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["development-tools","php","php-versions","php5","php7"],"created_at":"2024-09-24T19:58:32.451Z","updated_at":"2025-04-09T19:51:12.893Z","avatar_url":"https://github.com/rapidwebltd.png","language":"Shell","readme":"# 🔄 PHP Switch Scripts\n\nThese scripts are designed to aid in the setup of and switching between multiple PHP versions in Ubuntu 14.04 LTS or newer.\n\n\u003cimg src=\"assets/images/usage.png\" /\u003e\n\n\nPlease note that these scripts install packages from a third-party repository, provided by [Ondřej Surý](https://twitter.com/oerdnj). More details are available at the repository's [website](https://deb.sury.org/), [PPA page on Launchpad](https://launchpad.net/~ondrej/+archive/ubuntu/php/) and [Twitter account](https://twitter.com/debsuryorg).\n\n## Requirements\n\n* Ubuntu 14.04.* LTS or newer\n* Apache 2.4.*\n\nYou can check you have the required versions by running the following command.\n\n```\nlsb_release -a | grep Ubuntu \u0026\u0026 apache2 -v | grep Apache\n```\n\nYou should see something similar to the below.\n\n```\nDescription:    Ubuntu 14.04.5 LTS\nServer version: Apache/2.4.18 (Ubuntu)\n```\n\n## Setup\n\nFirst, clone the repository, and change directory if you have not already done so.\n\n```\ngit clone https://github.com/rapidwebltd/php-switch-scripts.git\ncd php-switch-scripts\n```\n\nNext, to setup all the supported PHP versions and common PHP extensions for them, you just need to run the `setup.sh` script. This is shown below.\n\n```\n./setup.sh\n```\n\nThis may take some time depending on your system and connection speed. It will also require you to enter your password to install new packages.\n\nWhen you see a message similar to the following, setup is complete and you are ready to switch between PHP versions at will.\n\n```\n* Setup complete. You may now use the 'switch-to-php-*.*.sh' scripts.`\n```\n\n## Usage\n\nOnce setup is complete, you can easily switch between different PHP versions using the appropriately named scripts. Examples are shown below.\n\n```\n./switch-to-php-5.6.sh\n./switch-to-php-7.0.sh\n./switch-to-php-7.1.sh\n./switch-to-php-7.2.sh\n./switch-to-php-7.3.sh\n./switch-to-php-7.4.sh\n```\n\nThis will alter the versions of PHP running in Apache and the command line. Your password will be required to enable/disable Apache modules, restart the web server and alter the default PHP CLI version.\n\n## Verification\n\nIf you wish, you can check that the switch was completed successfully.\n\nYou can verify the command line version of PHP has changed with the following command.\n\n```\nphp -v | grep PHP\n```\n\nYou can check the version of PHP running in Apache by creating a new PHP file, that calls the `phpinfo()` method, then accessing it via a web browser. An example is shown below.\n\n```php\n\u003c?php phpinfo(); ?\u003e\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapidwebltd%2Fphp-switch-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frapidwebltd%2Fphp-switch-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapidwebltd%2Fphp-switch-scripts/lists"}