Install and configure PHP on ubuntu? – User friendly Tech help

“Without new experiences, something inside of us sleeps. The sleeper must awaken.” Frank HerbertFrank Herbert t
n
nStep1:- Open terminal window and type the below command(install php)
n
nsudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
n

We have used extra parameters for configuring php to use apache server that we already installed and also to connect with mysql. So we dont do any configurations manually 
n
nStep2:- Verify the installation of PHP
nWe need to create sample php script inside the root of apache server and open it in the apache server
na) cd to apache root path, cd /var/www/html/
nb) Create test.php file, sudo nano test.php
nc)Add the basic phpinfo function call into file, save and exit (ctrl+x > y > enter) the nano editor
n

n

d) Start apache server (sudo apachectl start) and check the test.php file(open localhost/test.php) 

nn

Step3:- Configure php settings 
na)Lets say we want to enable php logs, we need to open php.ini file 
nsudo nano /etc/php/7.0/php.ini
nb)Search display_errors in php.ini file and turn it to on
nctrl+w(for searching in nano)
n
n
nc)Restart the apache server
nsudo apachectl restart
nd)Check that settings are changed by checking the browser
n

n

Was this article helpful?
YesNo

Similar Posts