install moodle in apache2 and php7.2 and ubuntu 18

apt-get install php-intl
apt-get install php-soap
apt-get install php-xmlrpc

 

edit php.ini and remove ; from :
extension=intl

extension=soap

extension=xmlrpc

and restart apache2

Soap client was not installed

Call to undefined method soapclient::()?

 

in php.ini:    

extension=soap

My problem was solved by running the lower commands in the terminal:

  1. sudo add-apt-repository ppa:ondrej/php

  2. sudo apt-get update

  3. sudo apt-get install php7.2-soap

 

restart apache

Codeigniter: fatal error call to undefined function mysqli_init()

sudo apt-get install php7.2-mysql

sudo service apache2 restart

Installing PHP 7.2 with Apache

Installing PHP 7.2 with Apache

If you are using Apache as your web server to install PHP and Apache PHP module run the following command:

sudo apt install php libapache2-mod-php

Once the packages are installed restart the Apache service:

sudo systemctl restart apache2

Required: Apache mod_rewrite is required

sudo a2enmod rewrite

service apache2 restart
 

The Simplest PHP Router

I wanted to create the absolute most basic routing code in PHP, so here it is. We will direct ALL traffic to index.php and route to the new files from there.

Redirect all requests to index.php

In the root of your project, create a .htaccess file that will redirect all requests to index.php.

.htaccess

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php [QSA,L]

Create a routing switch

Get the requested path with $_SERVER['REQUEST_URI'], and require the page you want to display. I have '' and '/' for both url.com/ and url.com.

index.php

Create the views

Create a /views directory and place the files.

/views/index.php

Main

/views/about.php

About

/views/404.php

404

That's it!