chicvorti.blogg.se

Install php
Install php








  1. #Install php how to#
  2. #Install php install#
  3. #Install php update#
  4. #Install php archive#
  5. #Install php windows 10#

Restart Apache: sudo service apache2 restartįinally, start Notepad or your favorite editor/IDE on Windows with admin privileges ( Run as administrator) and open the hosts file. We have to restart Apache: sudo service apache2 restartĬreate an info.php file in your project folder with the following content: ServerName myapp.test ServerAdmin DocumentRoot /var/combined Įnable the new site: sudo a2ensite myapp.test

#Install php install#

Install PHP 7.1 packages: sudo apt-get install php7.1 libapache2-mod-php7.1 php7.1-mcrypt php7.1-mysql php7.1-mbstring php7.1-gettext php7.1-xml php7.1-json php7.1-curl php7.1-zip

#Install php update#

Run the following script (this changes some of the less secure default options): mysql_secure_installation Step 4: installing PHPĪdd PPA for the latest PHP: sudo add-apt-repository ppa:ondrej/phpsudo apt-get update Choose a secure password and remember it, because you will need it later. You will be prompted to create a root password during the installation. Install MariaDB: sudo apt-get updatesudo apt-get install mariadb-server For example, you can enable mod_rewrite: sudo a2enmod rewritesudo service apache2 restart Step 3: installing the MariaDB serverĪdd a repo that contains the latest MariaDB packages: sudo apt-get install software-properties-common sudo apt-key adv -recv-keys -keyserver hkp://:80 0xF1656F24C74CD1D8 sudo add-apt-repository 'deb xenial main' Open in your browser and you should see the “It works” title.ĭon’t forget to enable Apache modules that are necessary for you. Start the Apache HTTP server: sudo service apache2 start

install php install php Open your favorite Windows editor/IDE, and create an “index.html” file in your project folder (C:\Users\ YOUR WINDOWS USERNAME\Documents\server) with the following content: It works! It works!

When you are finished, save the file by pressing Ctrl-O, and hit Enter to confirm. Modify the document root to “/var/CustomLog $/access.log combined Open the Apache default virtual host configuration file: sudo nano /etc/apache2/sites-enabled/nf sudo ln -s /mnt/c/Users/YOUR WINDOWS USERNAME/Documents/server /var/www/devroot sudo mkdir /mnt/c/Users/YOUR WINDOWS USERNAME/Documents/serverĬreate a symbolic link to the selected folder. Please replace YOUR WINDOWS USERNAME with your Windows username. The following command will create a server folder inside your Documents directory. I recommend you to use your Documents folder. This folder should be outside of the WSL filesystem. Install Apache: sudo apt-get install apache2Ĭreate a project folder for your web applications. Once the PPA is configured, update the local package index: sudo apt-get update To add the PPA, run the following command in the WSL bash: sudo add-apt-repository ppa:ondrej/apache2 Ondřej Surý’s PPA offers the latest Apache/PHP packages for Ubuntu.

#Install php archive#

A Personal Package Archive (PPA) is a repository that allows third-party developers to build and distribute packages for Ubuntu. We need to add a PPA for Apache packages. We want to install the latest stable version of Apache, but official Ubuntu repositories don’t contain the latest release. If you have successfully installed Bash on Ubuntu on Windows, let’s install and configure a simple LAMP stack for development.

#Install php how to#

Microsoft has a great tutorial on how to install WSL, please follow the instructions of the article. But, in this tutorial, we will set up the LAMP stack on Ubuntu, so you need to select Ubuntu. You can install more Linux distributions from the Microsoft Store (Ubuntu, openSUSE, SUSE Linux Enterprise Server 12). familiarity with Linux/bash (If you would like to get familiar with the command-line, you can read this DigitalOcean tutorial).įirst, you will need WSL installed on your computer.

#Install php windows 10#

A 64-bit version of Windows 10 with the Creators Update or later.Prerequisitesīefore you begin this guide, you will need the following: You can set up other stacks (for example, a LEMP stack) with similar methods. In this tutorial, we will set up a LAMP stack (Ubuntu 16.04, Apache, PHP 7.1, MariaDB) on WSL for development. These methods will work on the latest stable releases of Windows 10 as well. Note: This article is not only for the Windows Insiders. We can run a Linux environment directly on Windows without the overhead of a virtual machine. Microsoft says: “This is primarily a tool for developers - especially web developers and those who work on or with open source projects”.

install php

WSL is a compatibility layer for running Linux binary executables (in ELF format) natively on Windows 10. But, Microsoft now offers a great option for PHP developers who work on Windows: The Windows Subsystem for Linux (WSL). PHP development on Windows has some disadvantages. By András Magyar How to set up a PHP development environment on Windows Subsystem for Linux (WSL)










Install php