IF FTP Dosnt Work through PHP SCRIPT but Does Work through command line THEN follow the steps

FTP

run through root login

Check your status by running:

getsebool httpd_can_network_connect

If you get:

httpd_can_network_connect –> off

This may be your issue.

The Fix :

` Enable httpd_can_network_connect by running:

setsebool httpd_can_network_connect=1

Test your script again and see if it works. This worked for me so I made sure to set a policy to keep this enabled.

setsebool -P httpd_can_network_connect=1

NOTE: -P sets the policy so it persists over a reboot

Mount External Hard Drive in linux 

Mount External Hard Drive

On Server

Login as root

mount /dev/sdb1 /msbt_bkup_usb/

Before Command Run

NAME                        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT

sda                           8:0    0   2.5T  0 disk

├─sda1                        8:1    0   500M  0 part /boot

├─sda2                        8:2    0   1.5T  0 part

│ ├─vg_msdev-lv_root (dm-0) 253:0    0 693.6G  0 lvm  /

│ ├─vg_msdev-lv_swap (dm-1) 253:1    0   5.9G  0 lvm  [SWAP]

│ └─vg_msdev-lv_home (dm-2) 253:2    0   1.3T  0 lvm  /home

└─sda3                        8:3    0   548G  0 part

└─vg_msdev-lv_home (dm-2) 253:2    0   1.3T  0 lvm  /home

sr0                          11:0    1   1.8G  0 rom

sdb                           8:16   0   3.7T  0 disk

└─sdb1                        8:17   0   3.7T  0 part

Expected output of following Commands

[fpmsbte2016backup@localhost liveautobkup]$ lsblk

NAME                        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT

sr0                          11:0    1   1.8G  0 rom

sda                           8:0    0   2.5T  0 disk

├─sda1                        8:1    0   500M  0 part /boot

├─sda2                        8:2    0   1.5T  0 part

│ ├─vg_msdev-lv_root (dm-0) 253:0    0 693.6G  0 lvm  /

│ ├─vg_msdev-lv_swap (dm-1) 253:1    0   5.9G  0 lvm  [SWAP]

│ └─vg_msdev-lv_home (dm-2) 253:2    0   1.3T  0 lvm  /home

└─sda3                        8:3    0   548G  0 part

└─vg_msdev-lv_home (dm-2) 253:2    0   1.3T  0 lvm  /home

sdb                           8:16   0   3.7T  0 disk

└─sdb1                        8:17   0   3.7T  0 part /msbt_bkup_usb

IF Sever Doesnt Shutdown Properly

serverTo Start mysql from one server to another

ON 172.16.0.240 SERVER … Application (Give Same IP in BLOG)

SET ENFORCE

[root@msbtedevweb22 ~]# setenforce 0

[root@msbtedevweb22 ~]# service httpd restart

Redirecting to /bin/systemctl restart  httpd.service

ON 172.16.0.230 SERVER … DataBase Server (Give Same IP in BLOG)

mysql> flush privileges

-> ;

Query OK, 0 rows affected (0.00 sec)

[root@msbtedevdb22 ~]# setenforce 0

setenforce: SELinux is disabled

[root@msbtedevdb22 ~]# systemctl restart ld

How to install PHP 7.X in to CentOS 7.X

Step 1 : sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Step 3 : sudo yum install -y mod_php71w php71w-cli php71w-common php71w-gd php71w-mbstring php71w-mcrypt php71w-mysqlnd php71w-xml
if any conflicts due to old php version while installing php 7.X then
Step 4 :  Check the installed php packeges in to the system
rpm -qa | grep php
Step 5 : uninstall PHP listed packages in the step 4 uing
yum remove <package name>
Step 6 : Remove php Folder from /etc folder
Step 7 : Start from Step 1
Step 8 : If php is installed then restert apache using following command
sudo systemctl restart httpd.service