Installing Apache web server and PHP on the linux machine
Warning (2): key() expects parameter 1 to be array, null given [APP/Plugin/Feedback/View/Helper/RatingsHelper.php, line 73]Code Contextif (empty($model) && empty($modelClass))
{
$modelClass = key($this->models);
$data = array( 'Post' => array( 'id' => '4', 'postcategory_id' => '6', 'user_id' => '1', 'title' => 'Installing Apache web server and PHP on the linux machine', 'body' => '<p>Installing Apache web server on the Linux machine is hardly an issue. I recommend that first you update the repository of your linux machine, that means updating of mirror site urls in the <u>.repo file</u> from where Apache packages are being downloaded with all of their dependent packages. In the ubuntu you may get this file at <em>/etc/apt/sources.list </em>and in fedora it is at<em> /etc/yum.repos.d/. </em>Make sure your internet connectivity is strong while you install Apache and PHP described in this post as commands being used here are downloading all dependencies.</p> <p>Now open the command prompt window of your linux machine (you must know what that is).</p> <p>If you are using Fedora / RHEL / CentOS, type the following command:</p> <p><em>sudo yum update</em></p> <p>This will update installed all packages in your Linux.</p> <p>Now run the command for Fedora / RHEL / CentOs to start installation of Apache web server.</p> <p><em>sudo yum install httpd</em></p> <p>And start the apache web server with</p> <p><em>sudo /etc/init.d/httpd start</em><strong> </strong>or <em>systemctl</em><em> </em><em>start httpd.service</em></p> <p>You will prefer to start Apache web server in your machine as soon you boot and load the Linux in your machine so you do not have to explicitly start Apache every time you start the machine.</p> <p>Use following to get apache starts automatic with the Linux is loaded,</p> <p><em>sudo chkconfig httpd on</em><strong> </strong>or<strong> </strong><em>systemctl enable httpd.service</em></p> <p>Install PHP with the following command</p> <p><em>sudo yum install php php-common php-cli php-mysqlnd …….</em></p> <p>Space separated<strong> </strong>list of packages you want to install.</p> <p>You can also execute a one liner command to install Apache and PHP like,</p> <p><em>sudo yum install httpd httpd-devel mysql php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml –y</em></p> <p> </p> <p>Mostly you will find the configuration file for apache web server under <em>etc/httpd/conf/httpd.conf. </em> And the last line should install PHP version 5.X whichever is latest in your repo file, will be installed.</p> <p>Using my favorite debian or ubuntu flavor of linux!! follow this. Explanations for ubuntu commands are almost same as Fedora or CentOS.</p> <p><em>sudo apt-get update</em></p> <p><em>sudo apt-get install apache2</em></p> <p>Now use the command to start the apache web server.</p> <p><em>sudo /etc/init.d/apache2 start</em></p> <p>Start Aapche with the Ubuntu is boot and is loaded, with the command</p> <p><em>sudo chkconfig apache2 enable</em> or <em>sysv-rc-conf </em><em> </em><em>apache2 </em><em> on</em></p> <p>Install PHP with the following command</p> <p><em>sudo apt-get install php5 libapache2-mod-php5 php5-gd php5-mysql ……</em></p> <p>Space separated<strong> </strong>list of packages you want to install.</p> <p>If you hit the “localhost” in the browser url bar, it should show the page “It works”. That’s it for the Apache Web Server and PHP. This post just explains what you can do to install the Apache web server and PHP on the linux. Check the other post in the configuration category, if you want to know how <u>PHP is configured with Apache to work together.</u></p> <p>Keep me posting better ways of installations of Apache and PHP on the linux platform. Also let me know about your major troubleshooting and how you resolved that in this task to become helpful to others.</p> ', 'comment_count' => '3', 'postview_count' => '2388', 'active' => '1', 'created' => '2015-05-28 16:47:11', 'modified' => '2019-11-21 06:02:15', 'tags' => 'PHP, Linux, Apache, Installation' ), 'User' => array( 'id' => '1', 'firstname' => 'Chirayu' ), 'Postcoverimage' => array( 'namesmall' => '/files/uploads/postimages/Installing-apache-web-server-51077-small.jpg', 'namemedium' => '/files/uploads/postimages/Installing-apache-web-server-51077-medium.jpg' ), 'Rating' => array( (int) 0 => array( 'id' => '5', 'foreign_model' => 'Post', 'foreign_id' => '4', 'author_ip' => '106.78.235.173', 'rating' => '2.5', 'created' => '2016-01-01 13:09:16' ) ), 'Tag' => array( (int) 0 => array( 'id' => '4', 'name' => 'PHP', 'keyname' => 'php', 'Tagged' => array( [maximum depth reached] ) ), (int) 1 => array( 'id' => '8', 'name' => 'Linux', 'keyname' => 'linux', 'Tagged' => array( [maximum depth reached] ) ), (int) 2 => array( 'id' => '9', 'name' => 'Apache', 'keyname' => 'apache', 'Tagged' => array( [maximum depth reached] ) ), (int) 3 => array( 'id' => '10', 'name' => 'Installation', 'keyname' => 'installation', 'Tagged' => array( [maximum depth reached] ) ) ), 'RatingSummary' => array( 'total_votes' => (int) 1, 'total_rating' => (float) 2.5 ) ) $options = array() $model = null $modelClass = nullkey - [internal], line ?? RatingsHelper::prepareParams() - APP/Plugin/Feedback/View/Helper/RatingsHelper.php, line 73 RatingsHelper::display_for() - APP/Plugin/Feedback/View/Helper/RatingsHelper.php, line 48 include - APP/View/Posts/filter.ctp, line 30 View::_evaluate() - CORE/Cake/View/View.php, line 971 View::_render() - CORE/Cake/View/View.php, line 933 View::render() - CORE/Cake/View/View.php, line 473 Controller::render() - CORE/Cake/Controller/Controller.php, line 963 Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 200 Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 167 [main] - APP/webroot/index.php, line 109
Warning (2): current() expects parameter 1 to be array, null given [APP/Plugin/Feedback/View/Helper/RatingsHelper.php, line 74]Code Context{
$modelClass = key($this->models);
$model = current($this->models);
$data = array( 'Post' => array( 'id' => '4', 'postcategory_id' => '6', 'user_id' => '1', 'title' => 'Installing Apache web server and PHP on the linux machine', 'body' => '<p>Installing Apache web server on the Linux machine is hardly an issue. I recommend that first you update the repository of your linux machine, that means updating of mirror site urls in the <u>.repo file</u> from where Apache packages are being downloaded with all of their dependent packages. In the ubuntu you may get this file at <em>/etc/apt/sources.list </em>and in fedora it is at<em> /etc/yum.repos.d/. </em>Make sure your internet connectivity is strong while you install Apache and PHP described in this post as commands being used here are downloading all dependencies.</p> <p>Now open the command prompt window of your linux machine (you must know what that is).</p> <p>If you are using Fedora / RHEL / CentOS, type the following command:</p> <p><em>sudo yum update</em></p> <p>This will update installed all packages in your Linux.</p> <p>Now run the command for Fedora / RHEL / CentOs to start installation of Apache web server.</p> <p><em>sudo yum install httpd</em></p> <p>And start the apache web server with</p> <p><em>sudo /etc/init.d/httpd start</em><strong> </strong>or <em>systemctl</em><em> </em><em>start httpd.service</em></p> <p>You will prefer to start Apache web server in your machine as soon you boot and load the Linux in your machine so you do not have to explicitly start Apache every time you start the machine.</p> <p>Use following to get apache starts automatic with the Linux is loaded,</p> <p><em>sudo chkconfig httpd on</em><strong> </strong>or<strong> </strong><em>systemctl enable httpd.service</em></p> <p>Install PHP with the following command</p> <p><em>sudo yum install php php-common php-cli php-mysqlnd …….</em></p> <p>Space separated<strong> </strong>list of packages you want to install.</p> <p>You can also execute a one liner command to install Apache and PHP like,</p> <p><em>sudo yum install httpd httpd-devel mysql php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml –y</em></p> <p> </p> <p>Mostly you will find the configuration file for apache web server under <em>etc/httpd/conf/httpd.conf. </em> And the last line should install PHP version 5.X whichever is latest in your repo file, will be installed.</p> <p>Using my favorite debian or ubuntu flavor of linux!! follow this. Explanations for ubuntu commands are almost same as Fedora or CentOS.</p> <p><em>sudo apt-get update</em></p> <p><em>sudo apt-get install apache2</em></p> <p>Now use the command to start the apache web server.</p> <p><em>sudo /etc/init.d/apache2 start</em></p> <p>Start Aapche with the Ubuntu is boot and is loaded, with the command</p> <p><em>sudo chkconfig apache2 enable</em> or <em>sysv-rc-conf </em><em> </em><em>apache2 </em><em> on</em></p> <p>Install PHP with the following command</p> <p><em>sudo apt-get install php5 libapache2-mod-php5 php5-gd php5-mysql ……</em></p> <p>Space separated<strong> </strong>list of packages you want to install.</p> <p>If you hit the “localhost” in the browser url bar, it should show the page “It works”. That’s it for the Apache Web Server and PHP. This post just explains what you can do to install the Apache web server and PHP on the linux. Check the other post in the configuration category, if you want to know how <u>PHP is configured with Apache to work together.</u></p> <p>Keep me posting better ways of installations of Apache and PHP on the linux platform. Also let me know about your major troubleshooting and how you resolved that in this task to become helpful to others.</p> ', 'comment_count' => '3', 'postview_count' => '2388', 'active' => '1', 'created' => '2015-05-28 16:47:11', 'modified' => '2019-11-21 06:02:15', 'tags' => 'PHP, Linux, Apache, Installation' ), 'User' => array( 'id' => '1', 'firstname' => 'Chirayu' ), 'Postcoverimage' => array( 'namesmall' => '/files/uploads/postimages/Installing-apache-web-server-51077-small.jpg', 'namemedium' => '/files/uploads/postimages/Installing-apache-web-server-51077-medium.jpg' ), 'Rating' => array( (int) 0 => array( 'id' => '5', 'foreign_model' => 'Post', 'foreign_id' => '4', 'author_ip' => '106.78.235.173', 'rating' => '2.5', 'created' => '2016-01-01 13:09:16' ) ), 'Tag' => array( (int) 0 => array( 'id' => '4', 'name' => 'PHP', 'keyname' => 'php', 'Tagged' => array( [maximum depth reached] ) ), (int) 1 => array( 'id' => '8', 'name' => 'Linux', 'keyname' => 'linux', 'Tagged' => array( [maximum depth reached] ) ), (int) 2 => array( 'id' => '9', 'name' => 'Apache', 'keyname' => 'apache', 'Tagged' => array( [maximum depth reached] ) ), (int) 3 => array( 'id' => '10', 'name' => 'Installation', 'keyname' => 'installation', 'Tagged' => array( [maximum depth reached] ) ) ), 'RatingSummary' => array( 'total_votes' => (int) 1, 'total_rating' => (float) 2.5 ) ) $options = array() $model = null $modelClass = nullcurrent - [internal], line ?? RatingsHelper::prepareParams() - APP/Plugin/Feedback/View/Helper/RatingsHelper.php, line 74 RatingsHelper::display_for() - APP/Plugin/Feedback/View/Helper/RatingsHelper.php, line 48 include - APP/View/Posts/filter.ctp, line 30 View::_evaluate() - CORE/Cake/View/View.php, line 971 View::_render() - CORE/Cake/View/View.php, line 933 View::render() - CORE/Cake/View/View.php, line 473 Controller::render() - CORE/Cake/Controller/Controller.php, line 963 Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 200 Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 167 [main] - APP/webroot/index.php, line 109
Notice (8): Undefined index: [APP/Plugin/Feedback/View/Helper/RatingsHelper.php, line 81]Code Context$message_id = 'message-'.$random_id;
$values_id = 'values-'.$random_id;
$id = $data[$modelClass]['id'];
$data = array( 'Post' => array( 'id' => '4', 'postcategory_id' => '6', 'user_id' => '1', 'title' => 'Installing Apache web server and PHP on the linux machine', 'body' => '<p>Installing Apache web server on the Linux machine is hardly an issue. I recommend that first you update the repository of your linux machine, that means updating of mirror site urls in the <u>.repo file</u> from where Apache packages are being downloaded with all of their dependent packages. In the ubuntu you may get this file at <em>/etc/apt/sources.list </em>and in fedora it is at<em> /etc/yum.repos.d/. </em>Make sure your internet connectivity is strong while you install Apache and PHP described in this post as commands being used here are downloading all dependencies.</p> <p>Now open the command prompt window of your linux machine (you must know what that is).</p> <p>If you are using Fedora / RHEL / CentOS, type the following command:</p> <p><em>sudo yum update</em></p> <p>This will update installed all packages in your Linux.</p> <p>Now run the command for Fedora / RHEL / CentOs to start installation of Apache web server.</p> <p><em>sudo yum install httpd</em></p> <p>And start the apache web server with</p> <p><em>sudo /etc/init.d/httpd start</em><strong> </strong>or <em>systemctl</em><em> </em><em>start httpd.service</em></p> <p>You will prefer to start Apache web server in your machine as soon you boot and load the Linux in your machine so you do not have to explicitly start Apache every time you start the machine.</p> <p>Use following to get apache starts automatic with the Linux is loaded,</p> <p><em>sudo chkconfig httpd on</em><strong> </strong>or<strong> </strong><em>systemctl enable httpd.service</em></p> <p>Install PHP with the following command</p> <p><em>sudo yum install php php-common php-cli php-mysqlnd …….</em></p> <p>Space separated<strong> </strong>list of packages you want to install.</p> <p>You can also execute a one liner command to install Apache and PHP like,</p> <p><em>sudo yum install httpd httpd-devel mysql php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml –y</em></p> <p> </p> <p>Mostly you will find the configuration file for apache web server under <em>etc/httpd/conf/httpd.conf. </em> And the last line should install PHP version 5.X whichever is latest in your repo file, will be installed.</p> <p>Using my favorite debian or ubuntu flavor of linux!! follow this. Explanations for ubuntu commands are almost same as Fedora or CentOS.</p> <p><em>sudo apt-get update</em></p> <p><em>sudo apt-get install apache2</em></p> <p>Now use the command to start the apache web server.</p> <p><em>sudo /etc/init.d/apache2 start</em></p> <p>Start Aapche with the Ubuntu is boot and is loaded, with the command</p> <p><em>sudo chkconfig apache2 enable</em> or <em>sysv-rc-conf </em><em> </em><em>apache2 </em><em> on</em></p> <p>Install PHP with the following command</p> <p><em>sudo apt-get install php5 libapache2-mod-php5 php5-gd php5-mysql ……</em></p> <p>Space separated<strong> </strong>list of packages you want to install.</p> <p>If you hit the “localhost” in the browser url bar, it should show the page “It works”. That’s it for the Apache Web Server and PHP. This post just explains what you can do to install the Apache web server and PHP on the linux. Check the other post in the configuration category, if you want to know how <u>PHP is configured with Apache to work together.</u></p> <p>Keep me posting better ways of installations of Apache and PHP on the linux platform. Also let me know about your major troubleshooting and how you resolved that in this task to become helpful to others.</p> ', 'comment_count' => '3', 'postview_count' => '2388', 'active' => '1', 'created' => '2015-05-28 16:47:11', 'modified' => '2019-11-21 06:02:15', 'tags' => 'PHP, Linux, Apache, Installation' ), 'User' => array( 'id' => '1', 'firstname' => 'Chirayu' ), 'Postcoverimage' => array( 'namesmall' => '/files/uploads/postimages/Installing-apache-web-server-51077-small.jpg', 'namemedium' => '/files/uploads/postimages/Installing-apache-web-server-51077-medium.jpg' ), 'Rating' => array( (int) 0 => array( 'id' => '5', 'foreign_model' => 'Post', 'foreign_id' => '4', 'author_ip' => '106.78.235.173', 'rating' => '2.5', 'created' => '2016-01-01 13:09:16' ) ), 'Tag' => array( (int) 0 => array( 'id' => '4', 'name' => 'PHP', 'keyname' => 'php', 'Tagged' => array( [maximum depth reached] ) ), (int) 1 => array( 'id' => '8', 'name' => 'Linux', 'keyname' => 'linux', 'Tagged' => array( [maximum depth reached] ) ), (int) 2 => array( 'id' => '9', 'name' => 'Apache', 'keyname' => 'apache', 'Tagged' => array( [maximum depth reached] ) ), (int) 3 => array( 'id' => '10', 'name' => 'Installation', 'keyname' => 'installation', 'Tagged' => array( [maximum depth reached] ) ) ), 'RatingSummary' => array( 'total_votes' => (int) 1, 'total_rating' => (float) 2.5 ) ) $options = array() $model = null $modelClass = null $random_id = (int) 552696813 $element_id = 'rating-552696813' $message_id = 'message-552696813' $values_id = 'values-552696813'RatingsHelper::prepareParams() - APP/Plugin/Feedback/View/Helper/RatingsHelper.php, line 81 RatingsHelper::display_for() - APP/Plugin/Feedback/View/Helper/RatingsHelper.php, line 48 include - APP/View/Posts/filter.ctp, line 30 View::_evaluate() - CORE/Cake/View/View.php, line 971 View::_render() - CORE/Cake/View/View.php, line 933 View::render() - CORE/Cake/View/View.php, line 473 Controller::render() - CORE/Cake/Controller/Controller.php, line 963 Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 200 Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 167 [main] - APP/webroot/index.php, line 109
Notice (8): Undefined index: [APP/Plugin/Feedback/View/Elements/rating.ctp, line 59]Code ContextRating: {
foreign_model: '{$modelClass}',
foreign_id: '{$data[$modelClass]['id']}',
$viewFile = '/var/www/html/chirayuim/app/Plugin/Feedback/View/Elements/rating.ctp' $dataForView = array( 'tags' => array( (int) 0 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 1 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 2 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 3 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 4 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 5 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 6 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 7 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 8 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 9 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 10 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 11 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 12 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 13 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 14 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 15 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 16 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 17 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 18 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ), (int) 19 => array( 'Tagged' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), (int) 0 => array( [maximum depth reached] ) ) ), 'postcategories' => array( (int) 0 => array( 'Postcategory' => array( [maximum depth reached] ), 'ParentPostcategory' => array( [maximum depth reached] ), 'ChildPostcategory' => array([maximum depth reached]), 'Post' => array( [maximum depth reached] ), 'children' => array([maximum depth reached]) ), (int) 1 => array( 'Postcategory' => array( [maximum depth reached] ), 'ParentPostcategory' => array( [maximum depth reached] ), 'ChildPostcategory' => array([maximum depth reached]), 'Post' => array( [maximum depth reached] ), 'children' => array([maximum depth reached]) ), (int) 2 => array( 'Postcategory' => array( [maximum depth reached] ), 'ParentPostcategory' => array( [maximum depth reached] ), 'ChildPostcategory' => array( [maximum depth reached] ), 'Post' => array( [maximum depth reached] ), 'children' => array( [maximum depth reached] ) ), (int) 3 => array( 'Postcategory' => array( [maximum depth reached] ), 'ParentPostcategory' => array( [maximum depth reached] ), 'ChildPostcategory' => array([maximum depth reached]), 'Post' => array( [maximum depth reached] ), 'children' => array([maximum depth reached]) ) ), 'posts' => array( (int) 0 => array( 'Post' => array( [maximum depth reached] ), 'User' => array( [maximum depth reached] ), 'Postcoverimage' => array( [maximum depth reached] ), 'Rating' => array( [maximum depth reached] ), 'Tag' => array( [maximum depth reached] ), 'RatingSummary' => array( [maximum depth reached] ) ) ), 'masterclass' => '', 'appposts' => array( (int) 0 => array( 'Post' => array( [maximum depth reached] ), 'Postcoverimage' => array( [maximum depth reached] ), 'Tofriend' => array([maximum depth reached]) ), (int) 1 => array( 'Post' => array( [maximum depth reached] ), 'Postcoverimage' => array( [maximum depth reached] ), 'Tofriend' => array( [maximum depth reached] ) ), (int) 2 => array( 'Post' => array( [maximum depth reached] ), 'Postcoverimage' => array( [maximum depth reached] ), 'Tofriend' => array( [maximum depth reached] ) ), (int) 3 => array( 'Post' => array( [maximum depth reached] ), 'Postcoverimage' => array( [maximum depth reached] ), 'Tofriend' => array([maximum depth reached]) ), (int) 4 => array( 'Post' => array( [maximum depth reached] ), 'Postcoverimage' => array( [maximum depth reached] ), 'Tofriend' => array([maximum depth reached]) ) ), 'regions' => array(), 'appcountries' => array( (int) 1 => 'Andorra', (int) 2 => 'United Arab Emirates', (int) 3 => 'Afghanistan', (int) 4 => 'Antigua and Barbuda', (int) 5 => 'Anguilla', (int) 6 => 'Albania', (int) 7 => 'Armenia', (int) 8 => 'Netherlands Antilles', (int) 9 => 'Angola', (int) 12 => 'Argentina', (int) 13 => 'American Samoa', (int) 14 => 'Austria', (int) 15 => 'Australia', (int) 16 => 'Aruba', (int) 17 => 'Azerbaijan', (int) 18 => 'Bosnia and Herzegovina', (int) 19 => 'Barbados', (int) 20 => 'Bangladesh', (int) 21 => 'Belgium', (int) 22 => 'Burkina Faso', (int) 23 => 'Bulgaria', (int) 24 => 'Bahrain', (int) 25 => 'Burundi', (int) 26 => 'Benin', (int) 27 => 'Bermuda', (int) 28 => 'Brunei Darussalam', (int) 29 => 'Bolivia', (int) 30 => 'Brazil', (int) 31 => 'Bahamas', (int) 32 => 'Bhutan', (int) 34 => 'Botswana', (int) 35 => 'Belarus', (int) 36 => 'Belize', (int) 37 => 'Canada', (int) 38 => 'Cocos (Keeling) Islands', (int) 40 => 'Central African Republic', (int) 41 => 'Congo', (int) 42 => 'Switzerland', (int) 43 => 'Cote D'Ivoire', (int) 44 => 'Cook Islands', (int) 45 => 'Chile', (int) 46 => 'Cameroon', (int) 47 => 'China', (int) 48 => 'Colombia', (int) 49 => 'Costa Rica', (int) 51 => 'Cuba', (int) 52 => 'Cape Verde', (int) 53 => 'Christmas Island', (int) 54 => 'Cyprus', (int) 55 => 'Czech Republic', (int) 56 => 'Germany', (int) 57 => 'Djibouti', (int) 58 => 'Denmark', (int) 59 => 'Dominica', (int) 60 => 'Dominican Republic', (int) 61 => 'Algeria', (int) 62 => 'Ecuador', (int) 63 => 'Estonia', (int) 64 => 'Egypt', (int) 65 => 'Western Sahara', (int) 66 => 'Eritrea', (int) 67 => 'Spain', (int) 68 => 'Ethiopia', (int) 70 => 'Finland', (int) 71 => 'Fiji', (int) 72 => 'Falkland Islands (Malvinas)', (int) 73 => 'Micronesia, Federated States of', (int) 74 => 'Faroe Islands', (int) 75 => 'France', (int) 77 => 'Gabon', (int) 78 => 'United Kingdom', (int) 79 => 'Grenada', (int) 80 => 'Georgia', (int) 81 => 'French Guiana', (int) 82 => 'Ghana', (int) 83 => 'Gibraltar', (int) 84 => 'Greenland', (int) 85 => 'Gambia', (int) 86 => 'Guinea', (int) 87 => 'Guadeloupe', (int) 88 => 'Equatorial Guinea', (int) 89 => 'Greece', (int) 90 => 'South Georgia and Sandwich Island', (int) 91 => 'Guatemala', (int) 93 => 'Guinea-Bissau', (int) 94 => 'Guyana', (int) 95 => 'Hong Kong', (int) 97 => 'Honduras', (int) 98 => 'Croatia', (int) 99 => 'Haiti', (int) 100 => 'Hungary', (int) 101 => 'Indonesia', (int) 102 => 'Ireland', (int) 103 => 'Israel', (int) 104 => 'India', (int) 106 => 'Iraq', (int) 107 => 'Iran, Islamic Republic of', (int) 108 => 'Iceland', (int) 109 => 'Italy', (int) 110 => 'Jamaica', (int) 111 => 'Jordan', (int) 112 => 'Japan', (int) 113 => 'Kenya', (int) 114 => 'Kyrgyzstan', (int) 115 => 'Cambodia', (int) 116 => 'Kiribati', (int) 117 => 'Comoros', (int) 118 => 'Saint Kitts and Nevis', (int) 119 => 'Korea, Democratic', (int) 120 => 'Korea, Republic of', (int) 121 => 'Kuwait', (int) 122 => 'Cayman Islands', (int) 123 => 'Kazakhstan', (int) 124 => 'Laos', (int) 125 => 'Lebanon', (int) 126 => 'Saint Lucia', (int) 127 => 'Liechtenstein', (int) 128 => 'Sri Lanka', (int) 129 => 'Liberia', (int) 130 => 'Lesotho', (int) 131 => 'Lithuania', (int) 132 => 'Luxembourg', (int) 133 => 'Latvia', (int) 134 => 'Libya', (int) 135 => 'Morocco', (int) 136 => 'Monaco', (int) 137 => 'Moldova', (int) 138 => 'Madagascar', (int) 139 => 'Marshall Islands', (int) 140 => 'Macedonia', (int) 141 => 'Mali', (int) 142 => 'Myanmar', (int) 143 => 'Mongolia', (int) 144 => 'Macau', (int) 145 => 'Northern Mariana Islands', (int) 146 => 'Martinique', (int) 147 => 'Mauritania', (int) 148 => 'Montserrat', (int) 149 => 'Malta', (int) 150 => 'Mauritius', (int) 151 => 'Maldives', (int) 152 => 'Malawi', (int) 153 => 'Mexico', (int) 154 => 'Malaysia', (int) 155 => 'Mozambique', (int) 156 => 'Namibia', (int) 157 => 'New Caledonia', (int) 158 => 'Niger', (int) 159 => 'Norfolk Island', (int) 160 => 'Nigeria', (int) 161 => 'Nicaragua', (int) 162 => 'Netherlands', (int) 163 => 'Norway', (int) 164 => 'Nepal', (int) 165 => 'Nauru', (int) 166 => 'Niue', (int) 167 => 'New Zealand', (int) 168 => 'Oman', (int) 169 => 'Panama', (int) 170 => 'Peru', (int) 171 => 'French Polynesia', (int) 172 => 'Papua New Guinea', (int) 173 => 'Philippines', (int) 174 => 'Pakistan', (int) 175 => 'Poland', (int) 176 => 'Saint Pierre and Miquelon', (int) 177 => 'Pitcairn', (int) 180 => 'Portugal', (int) 181 => 'Palau', (int) 182 => 'Paraguay', (int) 183 => 'Qatar', (int) 184 => 'Reunion', (int) 185 => 'Romania', (int) 186 => 'Russian Federation', (int) 187 => 'Rwanda', (int) 188 => 'Saudi Arabia', (int) 189 => 'Solomon Islands', (int) 190 => 'Seychelles', (int) 191 => 'Sudan', (int) 192 => 'Sweden', (int) 193 => 'Singapore', (int) 194 => 'Saint Helena', (int) 195 => 'Slovenia', (int) 196 => 'Svalbard and Jan Mayen', (int) 197 => 'Slovakia', (int) 198 => 'Sierra Leone', (int) 199 => 'San Marino', (int) 200 => 'Senegal', (int) 201 => 'Somalia', (int) 202 => 'Suriname', (int) 203 => 'Sao Tome and Principe', (int) 204 => 'El Salvador', (int) 205 => 'Syrian Arab Republic', (int) 206 => 'Swaziland', (int) 207 => 'Turks and Caicos Islands', (int) 208 => 'Chad', (int) 209 => 'French Southern Territories', (int) 210 => 'Togo', (int) 211 => 'Thailand', (int) 212 => 'Tajikistan', (int) 213 => 'Tokelau', (int) 215 => 'Turkmenistan', (int) 216 => 'Tunisia', (int) 217 => 'Tonga', (int) 218 => 'Turkey', (int) 219 => 'Trinidad and Tobago', (int) 220 => 'Tuvalu', (int) 221 => 'Taiwan', (int) 222 => 'Tanzania, United Republic', (int) 223 => 'Ukraine', (int) 224 => 'Uganda', (int) 226 => 'United States', (int) 227 => 'Uruguay', (int) 228 => 'Uzbekistan', (int) 230 => 'Saint Vincent and the Grenadines', (int) 231 => 'Venezuela', (int) 232 => 'Virgin Islands, British', (int) 233 => 'Virgin Islands, U.S.', (int) 234 => 'Vietnam', (int) 235 => 'Vanuatu', (int) 236 => 'Wallis and Futuna', (int) 237 => 'Samoa', (int) 238 => 'Yemen', (int) 239 => 'Mayotte', (int) 240 => 'South Africa', (int) 241 => 'Zambia', (int) 242 => 'Zaire', (int) 243 => 'Zimbabwe' ), 'data' => array( 'Post' => array( 'id' => '4', 'postcategory_id' => '6', 'user_id' => '1', 'title' => 'Installing Apache web server and PHP on the linux machine', 'body' => '<p>Installing Apache web server on the Linux machine is hardly an issue. I recommend that first you update the repository of your linux machine, that means updating of mirror site urls in the <u>.repo file</u> from where Apache packages are being downloaded with all of their dependent packages. In the ubuntu you may get this file at <em>/etc/apt/sources.list </em>and in fedora it is at<em> /etc/yum.repos.d/. </em>Make sure your internet connectivity is strong while you install Apache and PHP described in this post as commands being used here are downloading all dependencies.</p> <p>Now open the command prompt window of your linux machine (you must know what that is).</p> <p>If you are using Fedora / RHEL / CentOS, type the following command:</p> <p><em>sudo yum update</em></p> <p>This will update installed all packages in your Linux.</p> <p>Now run the command for Fedora / RHEL / CentOs to start installation of Apache web server.</p> <p><em>sudo yum install httpd</em></p> <p>And start the apache web server with</p> <p><em>sudo /etc/init.d/httpd start</em><strong> </strong>or <em>systemctl</em><em> </em><em>start httpd.service</em></p> <p>You will prefer to start Apache web server in your machine as soon you boot and load the Linux in your machine so you do not have to explicitly start Apache every time you start the machine.</p> <p>Use following to get apache starts automatic with the Linux is loaded,</p> <p><em>sudo chkconfig httpd on</em><strong> </strong>or<strong> </strong><em>systemctl enable httpd.service</em></p> <p>Install PHP with the following command</p> <p><em>sudo yum install php php-common php-cli php-mysqlnd …….</em></p> <p>Space separated<strong> </strong>list of packages you want to install.</p> <p>You can also execute a one liner command to install Apache and PHP like,</p> <p><em>sudo yum install httpd httpd-devel mysql php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml –y</em></p> <p> </p> <p>Mostly you will find the configuration file for apache web server under <em>etc/httpd/conf/httpd.conf. </em> And the last line should install PHP version 5.X whichever is latest in your repo file, will be installed.</p> <p>Using my favorite debian or ubuntu flavor of linux!! follow this. Explanations for ubuntu commands are almost same as Fedora or CentOS.</p> <p><em>sudo apt-get update</em></p> <p><em>sudo apt-get install apache2</em></p> <p>Now use the command to start the apache web server.</p> <p><em>sudo /etc/init.d/apache2 start</em></p> <p>Start Aapche with the Ubuntu is boot and is loaded, with the command</p> <p><em>sudo chkconfig apache2 enable</em> or <em>sysv-rc-conf </em><em> </em><em>apache2 </em><em> on</em></p> <p>Install PHP with the following command</p> <p><em>sudo apt-get install php5 libapache2-mod-php5 php5-gd php5-mysql ……</em></p> <p>Space separated<strong> </strong>list of packages you want to install.</p> <p>If you hit the “localhost” in the browser url bar, it should show the page “It works”. That’s it for the Apache Web Server and PHP. This post just explains what you can do to install the Apache web server and PHP on the linux. Check the other post in the configuration category, if you want to know how <u>PHP is configured with Apache to work together.</u></p> <p>Keep me posting better ways of installations of Apache and PHP on the linux platform. Also let me know about your major troubleshooting and how you resolved that in this task to become helpful to others.</p> ', 'comment_count' => '3', 'postview_count' => '2388', 'active' => '1', 'created' => '2015-05-28 16:47:11', 'modified' => '2019-11-21 06:02:15', 'tags' => 'PHP, Linux, Apache, Installation' ), 'User' => array( 'id' => '1', 'firstname' => 'Chirayu' ), 'Postcoverimage' => array( 'namesmall' => '/files/uploads/postimages/Installing-apache-web-server-51077-small.jpg', 'namemedium' => '/files/uploads/postimages/Installing-apache-web-server-51077-medium.jpg' ), 'Rating' => array( (int) 0 => array( [maximum depth reached] ) ), 'Tag' => array( (int) 0 => array( [maximum depth reached] ), (int) 1 => array( [maximum depth reached] ), (int) 2 => array( [maximum depth reached] ), (int) 3 => array( [maximum depth reached] ) ), 'RatingSummary' => array( 'total_votes' => (int) 1, 'total_rating' => (float) 2.5 ) ), 'model' => null, 'modelClass' => null, 'submit_url' => '/feedback/ratings/add', 'element_id' => 'rating-552696813', 'message_id' => 'message-552696813', 'values_id' => 'values-552696813', 'readonly' => 'false', 'value' => (float) 2.5, 'votes' => (float) 1, 'user_vote' => (int) 0 ) $tags = array( (int) 0 => array( 'Tagged' => array( 'tag_id' => '1' ), 'Tag' => array( 'id' => '1', 'identifier' => null, 'name' => 'Configuration', 'keyname' => 'configuration', 'weight' => (float) 12, 'occurrence' => '2' ), (int) 0 => array( 'occurrence' => '2' ) ), (int) 1 => array( 'Tagged' => array( 'tag_id' => '2' ), 'Tag' => array( 'id' => '2', 'identifier' => null, 'name' => 'PHP5', 'keyname' => 'php5', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 2 => array( 'Tagged' => array( 'tag_id' => '3' ), 'Tag' => array( 'id' => '3', 'identifier' => null, 'name' => 'Apache2', 'keyname' => 'apache2', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 3 => array( 'Tagged' => array( 'tag_id' => '4' ), 'Tag' => array( 'id' => '4', 'identifier' => null, 'name' => 'PHP', 'keyname' => 'php', 'weight' => (float) 20, 'occurrence' => '6' ), (int) 0 => array( 'occurrence' => '6' ) ), (int) 4 => array( 'Tagged' => array( 'tag_id' => '5' ), 'Tag' => array( 'id' => '5', 'identifier' => null, 'name' => 'Sourcecode', 'keyname' => 'sourcecode', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 5 => array( 'Tagged' => array( 'tag_id' => '6' ), 'Tag' => array( 'id' => '6', 'identifier' => null, 'name' => 'Warnings', 'keyname' => 'warnings', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 6 => array( 'Tagged' => array( 'tag_id' => '7' ), 'Tag' => array( 'id' => '7', 'identifier' => null, 'name' => 'Timezone', 'keyname' => 'timezone', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 7 => array( 'Tagged' => array( 'tag_id' => '8' ), 'Tag' => array( 'id' => '8', 'identifier' => null, 'name' => 'Linux', 'keyname' => 'linux', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 8 => array( 'Tagged' => array( 'tag_id' => '9' ), 'Tag' => array( 'id' => '9', 'identifier' => null, 'name' => 'Apache', 'keyname' => 'apache', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 9 => array( 'Tagged' => array( 'tag_id' => '10' ), 'Tag' => array( 'id' => '10', 'identifier' => null, 'name' => 'Installation', 'keyname' => 'installation', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 10 => array( 'Tagged' => array( 'tag_id' => '11' ), 'Tag' => array( 'id' => '11', 'identifier' => null, 'name' => 'Open Authentication', 'keyname' => 'openauthentication', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 11 => array( 'Tagged' => array( 'tag_id' => '12' ), 'Tag' => array( 'id' => '12', 'identifier' => null, 'name' => 'Social Network Login', 'keyname' => 'socialnetworklogin', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 12 => array( 'Tagged' => array( 'tag_id' => '13' ), 'Tag' => array( 'id' => '13', 'identifier' => null, 'name' => 'oAuth', 'keyname' => 'oauth', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 13 => array( 'Tagged' => array( 'tag_id' => '14' ), 'Tag' => array( 'id' => '14', 'identifier' => null, 'name' => 'Web Developement', 'keyname' => 'webdevelopement', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 14 => array( 'Tagged' => array( 'tag_id' => '15' ), 'Tag' => array( 'id' => '15', 'identifier' => null, 'name' => 'Security', 'keyname' => 'security', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 15 => array( 'Tagged' => array( 'tag_id' => '16' ), 'Tag' => array( 'id' => '16', 'identifier' => null, 'name' => 'Code', 'keyname' => 'code', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 16 => array( 'Tagged' => array( 'tag_id' => '17' ), 'Tag' => array( 'id' => '17', 'identifier' => null, 'name' => 'Tips', 'keyname' => 'tips', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 17 => array( 'Tagged' => array( 'tag_id' => '18' ), 'Tag' => array( 'id' => '18', 'identifier' => null, 'name' => 'CSV files', 'keyname' => 'csvfiles', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 18 => array( 'Tagged' => array( 'tag_id' => '19' ), 'Tag' => array( 'id' => '19', 'identifier' => null, 'name' => 'File content', 'keyname' => 'filecontent', 'weight' => (float) 10, 'occurrence' => '1' ), (int) 0 => array( 'occurrence' => '1' ) ), (int) 19 => array( 'Tagged' => array( 'tag_id' => '20' ), 'Tag' => array( 'id' => '20', 'identifier' => null, 'name' => 'Software Design', 'keyname' => 'softwaredesign', 'weight' => (float) 12, 'occurrence' => '2' ), (int) 0 => array( 'occurrence' => '2' ) ) ) $postcategories = array( (int) 0 => array( 'Postcategory' => array( 'id' => '5', 'parent_id' => null, 'name' => 'PHP Configuration', 'active' => '1', 'lft' => '1', 'rght' => '2', 'created' => '2015-05-06 13:24:33', 'modified' => '2015-05-06 13:24:33' ), 'ParentPostcategory' => array( 'id' => null, 'parent_id' => null, 'name' => null, 'active' => null, 'lft' => null, 'rght' => null, 'created' => null, 'modified' => null ), 'ChildPostcategory' => array(), 'Post' => array( (int) 0 => array( [maximum depth reached] ), (int) 1 => array( [maximum depth reached] ), (int) 2 => array( [maximum depth reached] ) ), 'children' => array() ), (int) 1 => array( 'Postcategory' => array( 'id' => '6', 'parent_id' => null, 'name' => 'PHP installation', 'active' => '1', 'lft' => '3', 'rght' => '4', 'created' => '2015-05-06 13:36:53', 'modified' => '2015-05-06 13:36:53' ), 'ParentPostcategory' => array( 'id' => null, 'parent_id' => null, 'name' => null, 'active' => null, 'lft' => null, 'rght' => null, 'created' => null, 'modified' => null ), 'ChildPostcategory' => array(), 'Post' => array( (int) 0 => array( [maximum depth reached] ) ), 'children' => array() ), (int) 2 => array( 'Postcategory' => array( 'id' => '7', 'parent_id' => null, 'name' => 'Web development', 'active' => '1', 'lft' => '5', 'rght' => '8', 'created' => '2015-06-06 05:44:15', 'modified' => '2015-06-06 05:44:15' ), 'ParentPostcategory' => array( 'id' => null, 'parent_id' => null, 'name' => null, 'active' => null, 'lft' => null, 'rght' => null, 'created' => null, 'modified' => null ), 'ChildPostcategory' => array( (int) 0 => array( [maximum depth reached] ) ), 'Post' => array( (int) 0 => array( [maximum depth reached] ), (int) 1 => array( [maximum depth reached] ), (int) 2 => array( [maximum depth reached] ) ), 'children' => array( (int) 0 => array( [maximum depth reached] ) ) ), (int) 3 => array( 'Postcategory' => array( 'id' => '9', 'parent_id' => null, 'name' => 'Software Design', 'active' => '1', 'lft' => '9', 'rght' => '10', 'created' => '2017-07-12 16:27:21', 'modified' => '2017-07-12 16:27:21' ), 'ParentPostcategory' => array( 'id' => null, 'parent_id' => null, 'name' => null, 'active' => null, 'lft' => null, 'rght' => null, 'created' => null, 'modified' => null ), 'ChildPostcategory' => array(), 'Post' => array( (int) 0 => array( [maximum depth reached] ), (int) 1 => array( [maximum depth reached] ) ), 'children' => array() ) ) $posts = array( (int) 0 => array( 'Post' => array( 'id' => '4', 'postcategory_id' => '6', 'user_id' => '1', 'title' => 'Installing Apache web server and PHP on the linux machine', 'body' => '<p>Installing Apache web server on the Linux machine is hardly an issue. I recommend that first you update the repository of your linux machine, that means updating of mirror site urls in the <u>.repo file</u> from where Apache packages are being downloaded with all of their dependent packages. In the ubuntu you may get this file at <em>/etc/apt/sources.list </em>and in fedora it is at<em> /etc/yum.repos.d/. </em>Make sure your internet connectivity is strong while you install Apache and PHP described in this post as commands being used here are downloading all dependencies.</p> <p>Now open the command prompt window of your linux machine (you must know what that is).</p> <p>If you are using Fedora / RHEL / CentOS, type the following command:</p> <p><em>sudo yum update</em></p> <p>This will update installed all packages in your Linux.</p> <p>Now run the command for Fedora / RHEL / CentOs to start installation of Apache web server.</p> <p><em>sudo yum install httpd</em></p> <p>And start the apache web server with</p> <p><em>sudo /etc/init.d/httpd start</em><strong> </strong>or <em>systemctl</em><em> </em><em>start httpd.service</em></p> <p>You will prefer to start Apache web server in your machine as soon you boot and load the Linux in your machine so you do not have to explicitly start Apache every time you start the machine.</p> <p>Use following to get apache starts automatic with the Linux is loaded,</p> <p><em>sudo chkconfig httpd on</em><strong> </strong>or<strong> </strong><em>systemctl enable httpd.service</em></p> <p>Install PHP with the following command</p> <p><em>sudo yum install php php-common php-cli php-mysqlnd …….</em></p> <p>Space separated<strong> </strong>list of packages you want to install.</p> <p>You can also execute a one liner command to install Apache and PHP like,</p> <p><em>sudo yum install httpd httpd-devel mysql php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml –y</em></p> <p> </p> <p>Mostly you will find the configuration file for apache web server under <em>etc/httpd/conf/httpd.conf. </em> And the last line should install PHP version 5.X whichever is latest in your repo file, will be installed.</p> <p>Using my favorite debian or ubuntu flavor of linux!! follow this. Explanations for ubuntu commands are almost same as Fedora or CentOS.</p> <p><em>sudo apt-get update</em></p> <p><em>sudo apt-get install apache2</em></p> <p>Now use the command to start the apache web server.</p> <p><em>sudo /etc/init.d/apache2 start</em></p> <p>Start Aapche with the Ubuntu is boot and is loaded, with the command</p> <p><em>sudo chkconfig apache2 enable</em> or <em>sysv-rc-conf </em><em> </em><em>apache2 </em><em> on</em></p> <p>Install PHP with the following command</p> <p><em>sudo apt-get install php5 libapache2-mod-php5 php5-gd php5-mysql ……</em></p> <p>Space separated<strong> </strong>list of packages you want to install.</p> <p>If you hit the “localhost” in the browser url bar, it should show the page “It works”. That’s it for the Apache Web Server and PHP. This post just explains what you can do to install the Apache web server and PHP on the linux. Check the other post in the configuration category, if you want to know how <u>PHP is configured with Apache to work together.</u></p> <p>Keep me posting better ways of installations of Apache and PHP on the linux platform. Also let me know about your major troubleshooting and how you resolved that in this task to become helpful to others.</p> ', 'comment_count' => '3', 'postview_count' => '2388', 'active' => '1', 'created' => '2015-05-28 16:47:11', 'modified' => '2019-11-21 06:02:15', 'tags' => 'PHP, Linux, Apache, Installation' ), 'User' => array( 'id' => '1', 'firstname' => 'Chirayu' ), 'Postcoverimage' => array( 'namesmall' => '/files/uploads/postimages/Installing-apache-web-server-51077-small.jpg', 'namemedium' => '/files/uploads/postimages/Installing-apache-web-server-51077-medium.jpg' ), 'Rating' => array( (int) 0 => array( [maximum depth reached] ) ), 'Tag' => array( (int) 0 => array( [maximum depth reached] ), (int) 1 => array( [maximum depth reached] ), (int) 2 => array( [maximum depth reached] ), (int) 3 => array( [maximum depth reached] ) ), 'RatingSummary' => array( 'total_votes' => (int) 1, 'total_rating' => (float) 2.5 ) ) ) $masterclass = '' $appposts = array( (int) 0 => array( 'Post' => array( 'id' => '11', 'user_id' => '1', 'title' => 'Connecting remote server using SSH', 'body' => '<p>SSH stands for secured shall - a secured network service over an unsecured network. It is a network protocol. It provides an encrypted data communication between two computers. SSH can be used interactively to enable terminal sessions. SSH is also used in scripts to remotely and securely access data and other resources. In order to connect to remote server with SSH, you need:</p> <p>1) Server IP or domain name</p> <p>2) Username</p> <p>3) Password</p> <p>4) SSH client - I recommend PuTTY (you can easily download from internet) for windows operating system while Linux and MAC users can use OpenSSH which is mostly installed in their OS.</p> <p><strong>Useful SSH commands frequently used by developers:</strong></p> <p><em>>_ ssh <remote_host></em></p> <p><remote_host> is an IP address or domain name that you are trying to connect to. This command assumes that your username on the remote system is the same as your username on your local system.</p> <p> <em>>_ ssh remote_username@<remote_host></em></p> <p>If your username is different on the remote system. You can specify by using this syntax.</p> <p>Once you are connected to the server, you will be asked to provide a password. SSH works by connecting a client program to an SSH server. In above commands, SSH is the client program. The SSH server is at the <em>remote_host</em> that is specified.</p> <p><strong>How to configure SSH</strong></p> <p>When you change the configuration of SSH, you are changing the settings of the sshd server. In Ubuntu, the main sshd configuration file is located at <em>/etc/ssh/sshd_config</em>.</p> <p>While it is helpful to be able to log in to a remote system using passwords, it is much better idea to set up Key-based authentication.</p> <p>Key based authentication works by creating a pair of keys: <strong>a private key</strong> and <strong>a public key.</strong></p> <p>The private key is located on the client machine. The public key is placed on any server you wish to access. Please check how to generate public and private keys with PuTTY for windows and with ssh-keygen for linux and mac OS. The folder in which the private key is placed default in the windows is c:\users\<username>\.ssh while in unix based system it is under /home/<username>/.ssh</p> <p>The public key is added to a special file within the user account you will be logging into called ~/.ssh/authorized_keys</p> <p>When you attempt to connect using a key pair, the server will use the public key to create a message for the client computer that can only be read with private key.</p> <p>The client computer then sends the appropriate response back to the server and the server will know that the client is legitimate. This entire process is done in the background after keys are correctly setup.</p> <p>SSH operates on TCP port 22 by default. The server listens on port 22 though this can be changed through custom port number in <em>sshd_config</em> file.</p> <p><em>>_ ssh -p</em> <em>7322 remote_username@<remote_host></em></p> <p>If you are not connecting <em>remote host</em> at the default port 22, then you need to specify the custom port number in the command. The above command shows remote host is being connected at the port number 7322.</p> ', 'created' => '2019-11-29 13:06:49', 'tags' => '' ), 'Postcoverimage' => array( 'namesmall' => '/files/uploads/postimages/ssh-connect-16148-small.jpg', 'namemedium' => '/files/uploads/postimages/ssh-connect-16148-medium.jpg' ), 'Tofriend' => array() ), (int) 1 => array( 'Post' => array( 'id' => '10', 'user_id' => '0', 'title' => 'SOLID Part-2 : Principle of Open and Closed', 'body' => '<p>Any project has a scope of changes in terms of features, functionalities and workflows. Practically, to design application prefactly from begining is almost impossible even in the agile development. Classes and interfaces are pillers of application designs.</p> <p>SOLID is one of the proven set of design principles that are meant to guide developers to design and build robust, easily maintainable and scalable software.<br /> This article is focused ont he second principle of SOLID : The principle of Open / Closed.<br /> It satates that : Software entities (ie. classes, interfaces, functions etc) should be Open to extended but closed for modifications.<br /> Lets Check first what does it mean by this principle.</p> <p>A class is closed since it may be compiled, stored in the library, baselined and used by client classes. But it is also open, since any new class may use it as parent and adding new features.</p> <p>Fortunately we have a concept of Inheritance to achieve this goal. But, inheritance introduces tight coupling if the subclasses depend on implementation details of their parent class.</p> <p>my recomandation is to start designe inheritance with interfaces instead of superclasses. The interfaces are closed for modifications, you can provide new implementations to extend the functionality of your software.</p> <p>Let’s see an example that uses the Open/Closed Principle.</p> <p>We will need a Employee interface, the Company class, which uses the Employees, and some implementation of the Employee interface.<br /> The Company class should know just one thing about the Employees — what methods to call. This is what all the Employees have in common, so we will have a Employee interface with just the common methods(ie. someWork).</p> <p>public interface Employee{<br /> public void someWork();<br /> }</p> <p>And a Company class that encapsulates an Employye implementation and executes it.<br /> public class Company() {<br /> private Employee emp;<br /> // we set the strategy in the constructor<br /> public Company(Employee emp) {<br /> this.emp = emp;<br /> }</p> <p> public void completeTheWork() {<br /> this.emp.someWork();<br /> }<br /> }</p> <p>And let’s create two implementations for the Employee interface.</p> <p>public class Employee1 implements Employee {<br /> public void someWork() {<br /> System.out.println(“Work of Emoloyee 1”);<br /> }<br /> }</p> <p>public class Employee2 implements Employee {<br /> public void someWork() {<br /> System.out.println(“Work of Emoloyee 2”);<br /> }<br /> }</p> <p>Now lets use some dependency Injection to see how it works. We need to create one Perform class.</p> <p>public class Perform() {<br /> public static void main(String[] args) {<br /> Context context = new Company(new Employee1()); // we inject the Employee1<br /> context.completeTheWorky(); // it will print “Execute employee 1”;</p> <p> context = new Company(new Employee2()); // we inject the Employee2<br /> context.completeTheWork(); // it will print “Execute employee 2”<br /> }<br /> }</p> <p>So the Company is decoupled from a specific Employee class. You could implement many Employees it needed and no matter how they work and what you want them to do, you don’t need to modify the Company class. The Company class knows just that it must call someWork method and it is enough.</p> <p>After taking a closer look at the Single Responsibility Principle, we now discussed the Open/Closed Principle.<br /> It uses Interfaces to enable you the functionality of your application without changing the existing code.</p> ', 'created' => '2019-05-24 11:59:08', 'tags' => '' ), 'Postcoverimage' => array( 'namesmall' => '/files/uploads/postimages/Solid-part-2-28564-small.jpg', 'namemedium' => '/files/uploads/postimages/Solid-part-2-28564-medium.jpg' ), 'Tofriend' => array( (int) 0 => array( [maximum depth reached] ) ) ), (int) 2 => array( 'Post' => array( 'id' => '9', 'user_id' => '0', 'title' => 'SOLID Part-1 : Single Responsibility Principle - Software design', 'body' => '<p>S O L I D</p> <p>'S' represents Single Responsibility Principle</p> <p>Every class should have responsibility over a single part of the functionality provided by the software and that responsibility should be entirely encapsulated by the class. In other words there should never be more than one trigger or reason for a class to change. When a (functional) responsibility is divided over more than one class, all classes’ part of that responsibility has to change.</p> <p>The code must be maintainable. When we need to make a change in a class having more responsibilities the change might affect the other functionality related to the other responsibility of the class. The code, which cannot adapt to change requirements with ease, is not a well defined.</p> <p>When we design our classes, we should take care that one class at the most is responsible for doing only one task or single responsibility. Not only should the class, even operations or methods in the class defined in a way that it has only one responsibility to handle. To understand this let us take an example of Employee class. Class Employee is made with few of its attributes and operations.</p> <p>Class Employee{</p> <p> private String employeeId;</p> <p> private String name;</p> <p> private string address;</p> <p> private Date dateOfJoining;</p> <p> private Int DesignationId;</p> <p> </p> <p> public amtIncrement(){</p> <p> //increment logic implementation</p> <p> }</p> <p> public calDOR(){</p> <p> //Date of retirement logic implementation</p> <p> } </p> <p> public setDateOfJoining(){</p> <p> }</p> <p> public setEmployeeId(){</p> <p> }</p> <p> public getDateOfJoining(){</p> <p> }</p> <p> public getDesignationId(){ </p> <p> } </p> <p>}</p> <p>The above class is correctly structured and it has employee attributes declared. Also it has operations related to employee.</p> <p>Here Employee class should have only responsibility to maintain and manage the data of employee in formations. But this class is violating the principle of Single Responsibility. How?</p> <p><strong>First,</strong> the logic of calculating the Date of Retirement is not the employee's responsibility. This might be defined under the HR class and calculate by taking employee's Date of Joining in the organization which is an attribute of Employee class. So if any change happens in the HR policies, the Employee Class does not get updated. Just because HR policies updated this has nothing to do with the Employee entity.</p> <p><strong>Second,</strong> the logic of calculating the amount of increment is a responsibility of Finance class and it calculated by taking the level or designation of the employee in the organization. So if any change happens to the financial status, the Employee class doesn’t get affected with that.</p> <p>If the class has only one reason to change then it stays less fragile. More responsibilities lead to more dependencies and higher coupling. A test class for a ‘one responsibility class’ will have less test cases (branches). If a class has one purpose it will usually have less dependencies, thus less mocking and test preparing.</p> <p>The Single Responsibility Principle represents a good way of identifying classes during the design phase of an application and it reminds you to think of all the ways a class can evolve. Class and module design is highly affected by SRP and it leads to a low coupled design with less and lighter dependencies.</p> <p>Points to consider when you design the class.</p> <ul> <li>Define clearly what this class is going to do.</li> <li>Reduce the long procedures of the logic. Divide into multiple chunks.</li> <li>Write the code in the way that very small steps can be tested independently.</li> </ul> ', 'created' => '2017-07-12 16:42:05', 'tags' => '' ), 'Postcoverimage' => array( 'namesmall' => '/files/uploads/postimages/Solid-part-1-50472-small.jpg', 'namemedium' => '/files/uploads/postimages/Solid-part-1-50472-medium.jpg' ), 'Tofriend' => array( (int) 0 => array( [maximum depth reached] ), (int) 1 => array( [maximum depth reached] ), (int) 2 => array( [maximum depth reached] ) ) ), (int) 3 => array( 'Post' => array( 'id' => '8', 'user_id' => '0', 'title' => 'CSV files data into php array to store in MySql', 'body' => '<p><strong><em>What are CSV files?</em></strong></p> <p>A CSV (Comma Separated Values) files are text files, allows data to be saved in a structured format. CSV files can be used with Microsoft Excel, Google Spreadsheets or Open Office Calc kind of tools. These CSV files are saved with .csv extension. In CSV files data fields are usually separated by comma as delimiter, but can also use a tab or pipe symbol instead of comma. CSV files are used to import and export data from application to application. Mostly, the first record is a header containing a list of field names. Any programming language has technique to import and export data from and to database like MS-SQL, MySql, PostGres, etc..</p> <p>PHP is one of the best programming languages for import and export of the data with the database to and from flat files like CSV files.</p> <p><strong><em>Fetching the data from the CSV file</em></strong></p> <p>Open the file in the read mode and store the content into variable. We assume that the CSV file contains the information about the contacts having fields firstname, lastname, email, and phone exported and the file name is contacts.csv.</p> <p>$csvfilehandle = fopen("contacts.csv","r");</p> <p>Here $csvfilehandle is file pointer to a file "contacts.csv" successfully opened</p> <p>while (($line = fgetcsv($csvfilehandle,1000,',','"'))!==false){</p> <p> $data[] = $line;</p> <p>}</p> <p>Close the opened file handle with </p> <p>fclose($csvfilehandle);</p> <p>The first argument $csvfilehandle is the mandatory arguments and remaining are optional.</p> <p>1000 is a length of characters per line to be set. This should be greater than the longest line in the file. If you are not sure about the length then don`t specify it.</p> <p>',' comma is a delimiter you can set or according to the data in the file the delimiter is used.</p> <p>'"' is the enclosure in the file used for the field value</p> <p>Now you have all the data of the CSV file into the array $data. If you print this with print_r($data); you get values into array.</p> <p><strong><em>Importing data into MySQL table</em></strong></p> <p>Now to import the data into the MySQL table named contacts, we need to modify the above wile loop. Let`s do that now.</p> <p>while (($line = fgetcsv($csvfilehandle,1000,',','"'))!==false){ </p> <p> mysql_query("insert into contacts(</p> <p> firstname, lastname, email, telephone</p> <p> )VALUES(</p> <p> '".mysql_real_escape_string($line[0])."',</p> <p> '".mysql_real_escape_string($line[1])."',</p> <p> '".mysql_real_escape_string($line[2])."',</p> <p> '".mysql_real_escape_string($line[3])."'</p> <p> )")</p> <p>or die(mysql_error());</p> <p>}</p> <p>fclose($csvfilehandle);</p> <p>Write me back if you are working for such functionality and not getting through the code.</p> ', 'created' => '2016-11-03 07:17:48', 'tags' => '' ), 'Postcoverimage' => array( 'namesmall' => '/files/uploads/postimages/csv-files-data-into-88773-small.png', 'namemedium' => '/files/uploads/postimages/csv-files-data-into-88773-medium.png' ), 'Tofriend' => array() ), (int) 4 => array( 'Post' => array( 'id' => '7', 'user_id' => '0', 'title' => 'How the PHP script may report what is the total size of any web page browsed', 'body' => '<p>These days excellent work is being done to attract web site users by creating attractive and well managed web pages. While browsing any internet site or a web page as developer or designer of the web pages we might came across the thought, “how much size of this web page is? or how much costly to render this on my browser?”. Well today lets build a script which reports information of above questions. As usual we will be using PHP for scripting the code. This script includes two things in consideration. <strong>First,</strong> how many http/https requests are being used to render the page and <strong>Second,</strong> what is the total size of the rendered web page. We will create a script in a manner that it can be used from command line interface as well as from the browser. For this the cURL module is used. If it is not installed in your PHP set up then go to my previous article of installation and configuration of PHP.</p> <p>Ok. So now what is the meaning of <strong>First</strong> part, “how many http/https requests are”. When any web page is rendered or loaded in your browser, it is a combination of one or multiple CSS files, one or multiple javascripts or .js files, code of Html, multiple images, etc… we call them web page resources as all together they make a web page. While web page is loaded all these multiple files are being called from one or different locations with specific web address. These files are called one by one as it cannot called all once at a time. The separate calls for each of these files are known as http/https requests.</p> <p>Now let’s come to the Second part of the task – “what is the total size of the rendered web page” and that consist of file size of each of these resource we saw above. When http/https requests are responded uninterrupted then that response contains response header (developers and designers knows that). One of the headers is called “Content-Length” and that gives the size of that particular resource. We need to use built in API of PHP ie. get_headers and the argument would be the URL where the http/https request is sent. Bellow is the hint and good start of the code in PHP.</p> <p><strong><em>function file_size_rendered($url) { </em></strong></p> <p><strong><em>//where $url in the argument is the location where request is being sent.</em></strong></p> <p><strong><em> $headers = get_headers($url, 1);</em></strong> </p> <p><strong><em> if (isset($headers['Content-Length'])) </em></strong></p> <p><strong><em> return $headers['Content-Length'];</em></strong> </p> <p><strong><em>//Also check whether lower case of "L" is used in Content-length</em></strong></p> <p><strong><em> if (isset($headers['Content-length'])) </em></strong></p> <p><strong><em> return $headers['Content-length'];</em></strong></p> <p><strong><em>//if the content header is not found then use the curl request</em></strong></p> <p><strong><em> $c = curl_init();</em></strong></p> <p><strong><em> curl_setopt_array($c, array(</em></strong></p> <p><strong><em> CURLOPT_URL => $url,</em></strong></p> <p><strong><em> CURLOPT_RETURNTRANSFER => true,</em></strong></p> <p><strong><em> CURLOPT_HTTPHEADER => array('User-Agent: Mozilla/5.0 </em></strong></p> <p><strong><em> (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) </em></strong></p> <p><strong><em> Gecko/20090824 Firefox/3.5.3'),</em></strong></p> <p><strong><em> ));</em></strong></p> <p><strong><em> curl_exec($c);</em></strong> </p> <p><strong><em> $size = curl_getinfo($c, CURLINFO_SIZE_DOWNLOAD);</em></strong> </p> <p><strong><em> return $size;</em></strong> </p> <p><strong><em> curl_close($c);</em></strong></p> <p><strong><em>}</em></strong></p> <p>This article is just a good start to inspire for deeper understanding or the technique of coding. One can browse more or post questions to get answer on more specific tasks.</p> ', 'created' => '2015-12-28 10:52:20', 'tags' => '' ), 'Postcoverimage' => array( 'namesmall' => '/files/uploads/postimages/how-the-php-script-may-62903-small.jpg', 'namemedium' => '/files/uploads/postimages/how-the-php-script-may-62903-medium.jpg' ), 'Tofriend' => array() ) ) $regions = array() $appcountries = array( (int) 1 => 'Andorra', (int) 2 => 'United Arab Emirates', (int) 3 => 'Afghanistan', (int) 4 => 'Antigua and Barbuda', (int) 5 => 'Anguilla', (int) 6 => 'Albania', (int) 7 => 'Armenia', (int) 8 => 'Netherlands Antilles', (int) 9 => 'Angola', (int) 12 => 'Argentina', (int) 13 => 'American Samoa', (int) 14 => 'Austria', (int) 15 => 'Australia', (int) 16 => 'Aruba', (int) 17 => 'Azerbaijan', (int) 18 => 'Bosnia and Herzegovina', (int) 19 => 'Barbados', (int) 20 => 'Bangladesh', (int) 21 => 'Belgium', (int) 22 => 'Burkina Faso', (int) 23 => 'Bulgaria', (int) 24 => 'Bahrain', (int) 25 => 'Burundi', (int) 26 => 'Benin', (int) 27 => 'Bermuda', (int) 28 => 'Brunei Darussalam', (int) 29 => 'Bolivia', (int) 30 => 'Brazil', (int) 31 => 'Bahamas', (int) 32 => 'Bhutan', (int) 34 => 'Botswana', (int) 35 => 'Belarus', (int) 36 => 'Belize', (int) 37 => 'Canada', (int) 38 => 'Cocos (Keeling) Islands', (int) 40 => 'Central African Republic', (int) 41 => 'Congo', (int) 42 => 'Switzerland', (int) 43 => 'Cote D'Ivoire', (int) 44 => 'Cook Islands', (int) 45 => 'Chile', (int) 46 => 'Cameroon', (int) 47 => 'China', (int) 48 => 'Colombia', (int) 49 => 'Costa Rica', (int) 51 => 'Cuba', (int) 52 => 'Cape Verde', (int) 53 => 'Christmas Island', (int) 54 => 'Cyprus', (int) 55 => 'Czech Republic', (int) 56 => 'Germany', (int) 57 => 'Djibouti', (int) 58 => 'Denmark', (int) 59 => 'Dominica', (int) 60 => 'Dominican Republic', (int) 61 => 'Algeria', (int) 62 => 'Ecuador', (int) 63 => 'Estonia', (int) 64 => 'Egypt', (int) 65 => 'Western Sahara', (int) 66 => 'Eritrea', (int) 67 => 'Spain', (int) 68 => 'Ethiopia', (int) 70 => 'Finland', (int) 71 => 'Fiji', (int) 72 => 'Falkland Islands (Malvinas)', (int) 73 => 'Micronesia, Federated States of', (int) 74 => 'Faroe Islands', (int) 75 => 'France', (int) 77 => 'Gabon', (int) 78 => 'United Kingdom', (int) 79 => 'Grenada', (int) 80 => 'Georgia', (int) 81 => 'French Guiana', (int) 82 => 'Ghana', (int) 83 => 'Gibraltar', (int) 84 => 'Greenland', (int) 85 => 'Gambia', (int) 86 => 'Guinea', (int) 87 => 'Guadeloupe', (int) 88 => 'Equatorial Guinea', (int) 89 => 'Greece', (int) 90 => 'South Georgia and Sandwich Island', (int) 91 => 'Guatemala', (int) 93 => 'Guinea-Bissau', (int) 94 => 'Guyana', (int) 95 => 'Hong Kong', (int) 97 => 'Honduras', (int) 98 => 'Croatia', (int) 99 => 'Haiti', (int) 100 => 'Hungary', (int) 101 => 'Indonesia', (int) 102 => 'Ireland', (int) 103 => 'Israel', (int) 104 => 'India', (int) 106 => 'Iraq', (int) 107 => 'Iran, Islamic Republic of', (int) 108 => 'Iceland', (int) 109 => 'Italy', (int) 110 => 'Jamaica', (int) 111 => 'Jordan', (int) 112 => 'Japan', (int) 113 => 'Kenya', (int) 114 => 'Kyrgyzstan', (int) 115 => 'Cambodia', (int) 116 => 'Kiribati', (int) 117 => 'Comoros', (int) 118 => 'Saint Kitts and Nevis', (int) 119 => 'Korea, Democratic', (int) 120 => 'Korea, Republic of', (int) 121 => 'Kuwait', (int) 122 => 'Cayman Islands', (int) 123 => 'Kazakhstan', (int) 124 => 'Laos', (int) 125 => 'Lebanon', (int) 126 => 'Saint Lucia', (int) 127 => 'Liechtenstein', (int) 128 => 'Sri Lanka', (int) 129 => 'Liberia', (int) 130 => 'Lesotho', (int) 131 => 'Lithuania', (int) 132 => 'Luxembourg', (int) 133 => 'Latvia', (int) 134 => 'Libya', (int) 135 => 'Morocco', (int) 136 => 'Monaco', (int) 137 => 'Moldova', (int) 138 => 'Madagascar', (int) 139 => 'Marshall Islands', (int) 140 => 'Macedonia', (int) 141 => 'Mali', (int) 142 => 'Myanmar', (int) 143 => 'Mongolia', (int) 144 => 'Macau', (int) 145 => 'Northern Mariana Islands', (int) 146 => 'Martinique', (int) 147 => 'Mauritania', (int) 148 => 'Montserrat', (int) 149 => 'Malta', (int) 150 => 'Mauritius', (int) 151 => 'Maldives', (int) 152 => 'Malawi', (int) 153 => 'Mexico', (int) 154 => 'Malaysia', (int) 155 => 'Mozambique', (int) 156 => 'Namibia', (int) 157 => 'New Caledonia', (int) 158 => 'Niger', (int) 159 => 'Norfolk Island', (int) 160 => 'Nigeria', (int) 161 => 'Nicaragua', (int) 162 => 'Netherlands', (int) 163 => 'Norway', (int) 164 => 'Nepal', (int) 165 => 'Nauru', (int) 166 => 'Niue', (int) 167 => 'New Zealand', (int) 168 => 'Oman', (int) 169 => 'Panama', (int) 170 => 'Peru', (int) 171 => 'French Polynesia', (int) 172 => 'Papua New Guinea', (int) 173 => 'Philippines', (int) 174 => 'Pakistan', (int) 175 => 'Poland', (int) 176 => 'Saint Pierre and Miquelon', (int) 177 => 'Pitcairn', (int) 180 => 'Portugal', (int) 181 => 'Palau', (int) 182 => 'Paraguay', (int) 183 => 'Qatar', (int) 184 => 'Reunion', (int) 185 => 'Romania', (int) 186 => 'Russian Federation', (int) 187 => 'Rwanda', (int) 188 => 'Saudi Arabia', (int) 189 => 'Solomon Islands', (int) 190 => 'Seychelles', (int) 191 => 'Sudan', (int) 192 => 'Sweden', (int) 193 => 'Singapore', (int) 194 => 'Saint Helena', (int) 195 => 'Slovenia', (int) 196 => 'Svalbard and Jan Mayen', (int) 197 => 'Slovakia', (int) 198 => 'Sierra Leone', (int) 199 => 'San Marino', (int) 200 => 'Senegal', (int) 201 => 'Somalia', (int) 202 => 'Suriname', (int) 203 => 'Sao Tome and Principe', (int) 204 => 'El Salvador', (int) 205 => 'Syrian Arab Republic', (int) 206 => 'Swaziland', (int) 207 => 'Turks and Caicos Islands', (int) 208 => 'Chad', (int) 209 => 'French Southern Territories', (int) 210 => 'Togo', (int) 211 => 'Thailand', (int) 212 => 'Tajikistan', (int) 213 => 'Tokelau', (int) 215 => 'Turkmenistan', (int) 216 => 'Tunisia', (int) 217 => 'Tonga', (int) 218 => 'Turkey', (int) 219 => 'Trinidad and Tobago', (int) 220 => 'Tuvalu', (int) 221 => 'Taiwan', (int) 222 => 'Tanzania, United Republic', (int) 223 => 'Ukraine', (int) 224 => 'Uganda', (int) 226 => 'United States', (int) 227 => 'Uruguay', (int) 228 => 'Uzbekistan', (int) 230 => 'Saint Vincent and the Grenadines', (int) 231 => 'Venezuela', (int) 232 => 'Virgin Islands, British', (int) 233 => 'Virgin Islands, U.S.', (int) 234 => 'Vietnam', (int) 235 => 'Vanuatu', (int) 236 => 'Wallis and Futuna', (int) 237 => 'Samoa', (int) 238 => 'Yemen', (int) 239 => 'Mayotte', (int) 240 => 'South Africa', (int) 241 => 'Zambia', (int) 242 => 'Zaire', (int) 243 => 'Zimbabwe' ) $data = array( 'Post' => array( 'id' => '4', 'postcategory_id' => '6', 'user_id' => '1', 'title' => 'Installing Apache web server and PHP on the linux machine', 'body' => '<p>Installing Apache web server on the Linux machine is hardly an issue. I recommend that first you update the repository of your linux machine, that means updating of mirror site urls in the <u>.repo file</u> from where Apache packages are being downloaded with all of their dependent packages. In the ubuntu you may get this file at <em>/etc/apt/sources.list </em>and in fedora it is at<em> /etc/yum.repos.d/. </em>Make sure your internet connectivity is strong while you install Apache and PHP described in this post as commands being used here are downloading all dependencies.</p> <p>Now open the command prompt window of your linux machine (you must know what that is).</p> <p>If you are using Fedora / RHEL / CentOS, type the following command:</p> <p><em>sudo yum update</em></p> <p>This will update installed all packages in your Linux.</p> <p>Now run the command for Fedora / RHEL / CentOs to start installation of Apache web server.</p> <p><em>sudo yum install httpd</em></p> <p>And start the apache web server with</p> <p><em>sudo /etc/init.d/httpd start</em><strong> </strong>or <em>systemctl</em><em> </em><em>start httpd.service</em></p> <p>You will prefer to start Apache web server in your machine as soon you boot and load the Linux in your machine so you do not have to explicitly start Apache every time you start the machine.</p> <p>Use following to get apache starts automatic with the Linux is loaded,</p> <p><em>sudo chkconfig httpd on</em><strong> </strong>or<strong> </strong><em>systemctl enable httpd.service</em></p> <p>Install PHP with the following command</p> <p><em>sudo yum install php php-common php-cli php-mysqlnd …….</em></p> <p>Space separated<strong> </strong>list of packages you want to install.</p> <p>You can also execute a one liner command to install Apache and PHP like,</p> <p><em>sudo yum install httpd httpd-devel mysql php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml –y</em></p> <p> </p> <p>Mostly you will find the configuration file for apache web server under <em>etc/httpd/conf/httpd.conf. </em> And the last line should install PHP version 5.X whichever is latest in your repo file, will be installed.</p> <p>Using my favorite debian or ubuntu flavor of linux!! follow this. Explanations for ubuntu commands are almost same as Fedora or CentOS.</p> <p><em>sudo apt-get update</em></p> <p><em>sudo apt-get install apache2</em></p> <p>Now use the command to start the apache web server.</p> <p><em>sudo /etc/init.d/apache2 start</em></p> <p>Start Aapche with the Ubuntu is boot and is loaded, with the command</p> <p><em>sudo chkconfig apache2 enable</em> or <em>sysv-rc-conf </em><em> </em><em>apache2 </em><em> on</em></p> <p>Install PHP with the following command</p> <p><em>sudo apt-get install php5 libapache2-mod-php5 php5-gd php5-mysql ……</em></p> <p>Space separated<strong> </strong>list of packages you want to install.</p> <p>If you hit the “localhost” in the browser url bar, it should show the page “It works”. That’s it for the Apache Web Server and PHP. This post just explains what you can do to install the Apache web server and PHP on the linux. Check the other post in the configuration category, if you want to know how <u>PHP is configured with Apache to work together.</u></p> <p>Keep me posting better ways of installations of Apache and PHP on the linux platform. Also let me know about your major troubleshooting and how you resolved that in this task to become helpful to others.</p> ', 'comment_count' => '3', 'postview_count' => '2388', 'active' => '1', 'created' => '2015-05-28 16:47:11', 'modified' => '2019-11-21 06:02:15', 'tags' => 'PHP, Linux, Apache, Installation' ), 'User' => array( 'id' => '1', 'firstname' => 'Chirayu' ), 'Postcoverimage' => array( 'namesmall' => '/files/uploads/postimages/Installing-apache-web-server-51077-small.jpg', 'namemedium' => '/files/uploads/postimages/Installing-apache-web-server-51077-medium.jpg' ), 'Rating' => array( (int) 0 => array( 'id' => '5', 'foreign_model' => 'Post', 'foreign_id' => '4', 'author_ip' => '106.78.235.173', 'rating' => '2.5', 'created' => '2016-01-01 13:09:16' ) ), 'Tag' => array( (int) 0 => array( 'id' => '4', 'name' => 'PHP', 'keyname' => 'php', 'Tagged' => array( [maximum depth reached] ) ), (int) 1 => array( 'id' => '8', 'name' => 'Linux', 'keyname' => 'linux', 'Tagged' => array( [maximum depth reached] ) ), (int) 2 => array( 'id' => '9', 'name' => 'Apache', 'keyname' => 'apache', 'Tagged' => array( [maximum depth reached] ) ), (int) 3 => array( 'id' => '10', 'name' => 'Installation', 'keyname' => 'installation', 'Tagged' => array( [maximum depth reached] ) ) ), 'RatingSummary' => array( 'total_votes' => (int) 1, 'total_rating' => (float) 2.5 ) ) $model = null $modelClass = null $submit_url = '/feedback/ratings/add' $element_id = 'rating-552696813' $message_id = 'message-552696813' $values_id = 'values-552696813' $readonly = 'false' $value = (float) 2.5 $votes = (float) 1 $user_vote = (int) 0 $user_vote_message = 'Your vote: 0.0' $submitting_message = 'Sending vote...' $error_message = 'There was an error while saving your vote'include - APP/Plugin/Feedback/View/Elements/rating.ctp, line 59 View::_evaluate() - CORE/Cake/View/View.php, line 971 View::_render() - CORE/Cake/View/View.php, line 933 View::_renderElement() - CORE/Cake/View/View.php, line 1224 View::element() - CORE/Cake/View/View.php, line 418 RatingsHelper::display_for() - APP/Plugin/Feedback/View/Helper/RatingsHelper.php, line 53 include - APP/View/Posts/filter.ctp, line 30 View::_evaluate() - CORE/Cake/View/View.php, line 971 View::_render() - CORE/Cake/View/View.php, line 933 View::render() - CORE/Cake/View/View.php, line 473 Controller::render() - CORE/Cake/Controller/Controller.php, line 963 Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 200 Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 167 [main] - APP/webroot/index.php, line 109
Page 1 of 1, showing 1 records out of 1 total, starting on record 1, ending on 1