How to install PHP 7.2 on Ubuntu

sudo apt-get install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install -y php7.2 Set PHP5.6 as default version: $ sudo update-alternatives –set php /usr/bin/php5.6 Alternatively, you can run the following command to set which system wide version of PHP you want to use by default. $ sudo update-alternatives –config php Enter the selection number to set it as default version or simply press ENTER to keep the current

Facebook scrape page via api

First thing is get your app token. Check this page on how to get your access token . <?php $access_token = “{your app access token}”; $id = “page-to-scrape-again.html”; $params = array(“id”=>$id,”scrape”=>”true”,”access_token”=>$access_token); $ch = curl_init(“”); curl_setopt_array($ch, array( CURLOPT_RETURNTRANSFER=>true, CURLOPT_POST=>true, CURLOPT_POSTFIELDS=>$params )); $result = curl_exec($ch); That’s it.


Below is a simple example for GET and POST Request. GET Request // Get cURL resource $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_URL, ‘’); // Send the request & save response to $resp $resp = curl_exec($curl); // Close request to clear up some resources curl_close($curl); If you want to send a parameter along in the request, simply append them in the URL. ex: POST Request Simply set the CURLOPT_POST option to