Useful Linux Commands help you in web Development

Sharing is caring!

541 Views -

How to Start and Stop Apache Server

sudo /etc/init.d/apache2 stop - Stop Apache server
sudo /opt/lampp/lampp start - Start server again

Install composer globally-

Create laravel project using composer –

php /usr/local/bin/composer create-project --prefer-dist laravel/laravel winelabel

Edit php.ini file –

sudo gedit /opt/lampp/etc/php.ini
sudo chmod -R 777 storage

After too many problems, the below steps solved this for me:

find php.ini path via phpinfo()

uncomment

1-extension=php_pdo_mysql.dll

add this line

2-extension=pdo_mysql.so

then run

3-sudo apt-get -y install php5-mysql

restart apache

alias composer='/usr/local/bin/composer'

change from Php 5 to PHP 7

sudo a2dismod php5
sudo a2enmod php7.0
sudo service apache2 restart

Delete directory

sudo rm -rf directory_name

Install GD Library-

PHP7 packages for Ubuntu including php7.0-gd can be installed via PPA for PHP by Ondřej Surý:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Next, install the desired version:

sudo apt-get install php7.0-gd
# or
sudo apt-get install php7.1-gd
# or
sudo apt-get install php7.2-gd

start xampp

sudo /opt/lampp/lampp start
stop apache and mysql first -
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/mysql stop

chown

sudo chown php:php -R laravel.log

Install PHP7.1

sudo apt-get install php7.1

sudo apt-get install php7.1-gd
sudo apt-get install php-gd php-xml php7.1-mbstring

Disable old PHP version while enabling new

sudo a2dismod php7.0

Enable new PHP

a2enmod php7.2

sudo apt install php7.1-mysql

sudo apt-get install php7.1-curl

Edit Php.ini file on Apache

sudo gedit /etc/php/7.1/apache2/php.ini

sudo service apache2 restart

Import database using the command line on ubuntu

mysql -u root -p pbc < /home/php/Downloads/database.sql

Install Imagick image library

sudo apt-get install php5.6-imagick
sudo service apache2 graceful

Create HOSTS CONF

cd /etc/apache2/
ls -la sites-available/
sudo gedit sites-available/isdn.local.conf
sudo gedit /etc/hosts
sudo /etc/init.d/apache2 restart

 

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments