Close

PHP: Check broken links using curl

[code language=”php”] function check_url($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); $headers = curl_getinfo($ch); curl_close($ch); return $headers[‘http_code’]; } $mainurl = "http://www.google.com"; $myurl = "http://www.google.com/gggg"; $mainsite = check_url($mainurl); $satus = check_url($myurl); if($mainsite == ‘200’){ if($satus == ‘200’){ echo "Its works"; }else{ echo "broken url"; } }else{ echo…

Install Nginx Using Yum Command

Step #1: Install nginx repo Type the following wget command to install nginx yum configuration file: [code language=”php”] # cd /tmp [/code] CentOS Linux v6.x user type the following command: [code language=”php”] # wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm # rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm [/code] Step #2: Install nginx web-server Type the following yum command to install nginx web-server: [code…