Alternatively execute the following command to locate the loaded php --ini | grep Loaded Loaded Configuration File: /etc/php/7.3/cli/php.ini3 command: Show
php --ini | grep Loaded Loaded Configuration File: /etc/php/7.3/cli/php.ini Please, note that the above php --ini | grep Loaded Loaded Configuration File: /etc/php/7.3/cli/php.ini3command. For the Apache web-server the above path will translate to: This article requires Windows 10 (Build Version 1709 [The Fall Creators Update]) or above to work. Although WSL exists since Version 1607 [Anniversary Update], it’s harder to setup and more buggy. In this tutorial we will setup this development environment in WSL (In Part 1) With those tools under Windows 10 (In Part 2) A. Installation1. Enable “Windows Subsystem for Linux”Start > Search “Turn Windows features on or off” Check “Windows Subsystem for Linux”, Click “OK”, Reboot 2. Install Ubuntu 18.04 on WIndowsStart > Search”Microsoft Store”, open it and search for “Ubuntu 18.04” 3. Start enjoying your Linux subsystem!B. Install and Configure PackagesPart B works exactly the same way as Ubuntu 18.04. 1. Update all installed packagesLet’s do a apt install -y php7.2-cli php7.2-fpm php7.2-opcache php7.2-mysql php7.2-mbstring php7.2-xml php7.2-zip php7.2-bz2 php7.2-curl php7.2-gd apt install -y apache2 apt install -y mysql-server apt install -y git3 firstsudo -i apt update apt dist-upgrade 2. Install Apache, PHP, MySQL, gitapt install -y php7.2-cli php7.2-fpm php7.2-opcache php7.2-mysql php7.2-mbstring php7.2-xml php7.2-zip php7.2-bz2 php7.2-curl php7.2-gd apt install -y apache2 apt install -y mysql-server apt install -y git 3. Configure PHPEnable PHP FPM for Apache a2enconf php7.2-fpm a2enmod proxy_fcgi Increase PHP resources limits for development sed -i 's|post_max_size = [0-9]\+M|post_max_size = 128M|g' /etc/php/7.2/fpm/php.ini sed -i 's|upload_max_filesize = [0-9]\+M|upload_max_filesize = 128M|g' /etc/php/7.2/fpm/php.ini sed -i 's|memory_limit = [0-9]\+M|memory_limit = 512M|g' /etc/php/7.2/fpm/php.ini sed -i 's|max_execution_time = [0-9]\+|max_execution_time = 300|g' /etc/php/7.2/fpm/php.ini sed -i 's|gc_maxlifetime = [0-9]\+|gc_maxlifetime = 86400|g' /etc/php/7.2/fpm/php.ini sed -i 's|pm.max_children = [0-9]\+|pm.max_children = 25|g' /etc/php/7.2/fpm/pool.d/www.conf sed -i 's|pm.start_servers = [0-9]\+|pm.start_servers = 5|g' /etc/php/7.2/fpm/pool.d/www.conf sed -i 's|pm.min_spare_servers = [0-9]\+|pm.min_spare_servers = 5|g' /etc/php/7.2/fpm/pool.d/www.conf sed -i 's|pm.max_spare_servers = [0-9]\+|pm.max_spare_servers = 10|g' /etc/php/7.2/fpm/pool.d/www.conf 4. Configure Apache2Enable rewrite module a2enmod rewrite Enable .htaccess in all directories sed -i ':a;N;$!ba;s/AllowOverride None/AllowOverride All/3' /etc/apache2/apache2.conf 5. Configure MySQLRemove test user and databases
It will make several changes to MySQL login crediitcal Enable MySQL root password login mysql ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'some_strong_password'; FLUSH PRIVILEGES; exit 6. Install and enable phpMyAdmin (From git)git clone --depth=1 --branch=STABLE git://github.com/phpmyadmin/phpmyadmin.git /var/www/phpMyAdmin randomBlowfishSecret=`openssl rand -base64 32`; sed -e "s|cfg\['blowfish_secret'\] = ''|cfg['blowfish_secret'] = '$randomBlowfishSecret'|" /var/www/phpMyAdmin/config.sample.inc.php > /var/www/phpMyAdmin/config.inc.php cd /var/www/phpMyAdmin composer install --no-dev apt install -y php7.2-cli php7.2-fpm php7.2-opcache php7.2-mysql php7.2-mbstring php7.2-xml php7.2-zip php7.2-bz2 php7.2-curl php7.2-gd apt install -y apache2 apt install -y mysql-server apt install -y git0 7. Install composer (From official installer)apt install -y php7.2-cli php7.2-fpm php7.2-opcache php7.2-mysql php7.2-mbstring php7.2-xml php7.2-zip php7.2-bz2 php7.2-curl php7.2-gd apt install -y apache2 apt install -y mysql-server apt install -y git1 8. Start everything!apt install -y php7.2-cli php7.2-fpm php7.2-opcache php7.2-mysql php7.2-mbstring php7.2-xml php7.2-zip php7.2-bz2 php7.2-curl php7.2-gd apt install -y apache2 apt install -y mysql-server apt install -y git2 Yes, something unusual start appear from here. You may also encounter “ apt install -y php7.2-cli php7.2-fpm php7.2-opcache php7.2-mysql php7.2-mbstring php7.2-xml php7.2-zip php7.2-bz2 php7.2-curl php7.2-gd apt install -y apache2 apt install -y mysql-server apt install -y git4” when starting Apache2. It doesn’t harm anything, we will remove that later, however. 9. Basic installation completeYou now have PHP, Apache, MySQL working, and phpMyAdmin under http://127.0.0.1/phpMyAdmin In next part we will go though the special attributes and gotchas of the Linux subsystem.
Where do I find my PHP ini file?ini file is the default configuration file for running applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits. This file is located on your server in the /public_html folder.
Where is my PHP ini file in Windows?In Windows Explorer, open your PHP installation folder, for example C:\PHP . In a text editor, open the php. ini file.
Where do I find PHP ini on Linux?The default location for the php. ini file is: Ubuntu 16.04: /etc/php/7.0/apache2. CentOS 7: /etc/php.
How to run PHP file in WSL?Configure WSL. Download and install a WSL distribution (for instance, Ubuntu) from Microsoft Store. ... . Run the Linux distribution. ... . Inside the Linux installation, make sure PHP is installed. ... . Configure a WSL-based remote interpreter as described in Configure remote PHP interpreters.. |