![]() In order to set up proper permissions for your /var/www/html folder, just run the following 2 commands: sudo usermod -aG www-data $USER Step 5 (Optional) - Setting up proper permissions Run the following command to confirm the successful SWAP file creation: free -h Press control+x and they Y to save and exit. ![]() In order to do this, run the following commands: sudo nano /etc/nfĪnd add the following 2 lines at the end of the nf file: vm.swappiness=10 ![]() ![]() Now we need to add 2 parameters in nf file. We’ll run the following commands to setup SWAP memory of 2GB: sudo fallocate -l 2G /swapfileĮcho ‘/swapfile none swap sw 0 0’ | sudo tee -a /etc/fstab You can confirm your PHP version by running the following command: php -v Step 4 (Optional) - Setting up SWAP memory Now you’ve installed Latest PHP and its most useful and needed extensions on your Ubuntu 22.04 machine. To enable the extension for apache, run the following command: echo "extension=mcrypt.so" | sudo tee -a /etc/php/8.1/apache2/conf.d/mcrypt.iniĪfter this, restart apache sudo service apache2 restart Just press enter when it asks about the libmcrypt prefix. In order to install “mcrypt” extension, we will have to run following commands to install its pre-requisites first: sudo apt-get install php-dev php-pear libmcrypt-dev gcc make autoconf libc-dev pkg-configĪfter this, we’ll have to run the following commands to compile the mcrypt extension: sudo pecl install mcrypt In order to install the latest PHP and all the related packages, please run the following command: sudo apt install php libapache2-mod-php php-mysql php-curl php-xml php-gd mysql-client zip unzip php-zip php-json php-mbstring In order to exit the MySQL console, type exit: exit Step 3 - Installing PHP When you’re finished, test whether you’re able to log in to the MySQL console by typing: sudo mysql Now Apache is installed, you can confirm this by visiting: You should see Apache’s default page like the below screenshot:Īpache’s Default Page Step 2 - Installing MySQL sudo apt-get install mysql-server mysql-client If you’re interested, please use Google search. Please confirm Apache’s installation by pressing Y, then ENTER.Īfter this is done, we need to adjust the firewall settings by running the following commands: sudo ufw app listĮxplaining these commands in detail doesn’t make much sense here. sudo apt-get updateĪfter this, we’ll install Apache by running the following command in our terminal: sudo apt-get install apache2 We will start by updating the package manager cache of our Ubuntu system. The Apache web server is popularly used, well documented, and has an active community of users. Step 1 - Installing Apache and Updating the Firewall In order to complete this tutorial, you have to have an Ubuntu 22.04 server with a sudo-enabled user account. Signup DigitalOcean using this link and get $100 worth of credits for FREE. If you don’t have an Ubuntu machine, you can try DigitalOcean to get a machine (or VPS), popularly known as DROPLET in the DigitalOcean community. ![]() All of these are open-source software and are installed together in order to enable a web server to host PHP-based web applications and dynamic websites (based on WordPress CMS etc).īy the end of this tutorial, you’ll be able to set up a LAMP stack on an Ubuntu 22.04 machine. “LAMP” stack is a very popular word nowadays and it just means – Linux (Ubuntu comes under this), Apache, MySQL, and PHP. Introduction – Install Apache PHP MySQL on Ubuntu 22.04 Step 7 (Optional) - Setup Memcached cache software.Step 6 (Optional) - Basic commands for creating a database, a user, and giving it permissions to access it.Step 5 (Optional) - Setting up proper permissions.Step 4 (Optional) - Setting up SWAP memory.Step 1 - Installing Apache and Updating the Firewall.Introduction – Install Apache PHP MySQL on Ubuntu 22.04. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |