{"id":411,"date":"2015-11-09T14:22:41","date_gmt":"2015-11-09T06:22:41","guid":{"rendered":"https:\/\/woohuiren.me\/blog\/?p=411"},"modified":"2016-03-05T00:30:04","modified_gmt":"2016-03-04T16:30:04","slug":"installing-laravel-5-on-fedora","status":"publish","type":"post","link":"https:\/\/woohuiren.me\/blog\/installing-laravel-5-on-fedora\/","title":{"rendered":"Installing Laravel 5 on Fedora"},"content":{"rendered":"<p>So I&#8217;ve encountered some issues with installing Laravel 5 on Fedora and finally resolved all of them. I have decided to make this blog post just for you so that I can share the knowledge and experience I have gained with you. Please note that this guide is <strong>not recommended<\/strong> for production purposes as I will be disabling SELinux and editing Apache configuration file. <\/p>\n<p>This is a LAMP stack Laravel 5 installation guide. You will need to fulfill the following prerequisites: <\/p>\n<ul>\n<li>Fedora 20+ Linux Server<\/li>\n<li>1GB RAM<\/li>\n<li>1 CPU<\/li>\n<li>10GB disk space<\/li>\n<\/ul>\n<p>Cloudshards offers really affordable virtual private servers which fulfill the above specifications stated <a href=\"https:\/\/www.cloudshards.com\/cart.php?a=add&#038;pid=209\" target=\"_blank\">for just $5\/monthly<\/a>. So feel free to order one if you would like to. Alternatively, <a href=\"https:\/\/www.openshift.com\/\" target=\"_blank\">Openshift<\/a> offers free Laravel hosting but installation steps for Openshift is not covered in this guide. <\/p>\n<p>First off, we&#8217;ll need to install the necessary server software to run a web and SQL server. So, let&#8217;s begin with installing Apache, PHP and MariaDB using dnf. Login to your server via your preferred SSH terminal and run the following command. <\/p>\n<pre>sudo dnf install php php-pdo php-mysqlnd php-common php-mbstring php-mcrypt php-zip php-xml git httpd mariadb mariadb-server<\/pre>\n<p>Laravel 5 offers several ways of installation. In this guide, we&#8217;ll be doing it through composer as it offers simplicity and ease. Download and install composer.<\/p>\n<pre>curl -sS https:\/\/getcomposer.org\/installer | sudo php -- --install-dir=\/usr\/local\/bin --filename=composer<\/pre>\n<p>Run the Laravel installation using composer.<\/p>\n<pre>composer create-project laravel\/laravel --prefer-dist<\/pre>\n<p>Update directory permissions and disable SELinux. <\/p>\n<pre>chmod 0775 bootstrap\/cache\r\nchmod 0775 storage\r\nsudo setenforce 0<\/pre>\n<p>To disable SELinux permanently, edit your SELinux configuration file and change &#8216;SELINUX=enforcing&#8217; to &#8216;SELINUX=disabled&#8217;.<\/p>\n<pre>sudo vi \/etc\/selinux\/config<\/pre>\n<p><a href=\"https:\/\/i0.wp.com\/woohuiren.me\/blog\/wp-content\/uploads\/2015\/11\/selinux.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/woohuiren.me\/blog\/wp-content\/uploads\/2015\/11\/selinux.jpg?resize=675%2C426&#038;ssl=1\" alt=\"selinux\" width=\"675\" height=\"426\" class=\"alignnone size-full wp-image-420\" srcset=\"https:\/\/i0.wp.com\/woohuiren.me\/blog\/wp-content\/uploads\/2015\/11\/selinux.jpg?w=675&amp;ssl=1 675w, https:\/\/i0.wp.com\/woohuiren.me\/blog\/wp-content\/uploads\/2015\/11\/selinux.jpg?resize=300%2C189&amp;ssl=1 300w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/p>\n<p>This is to allow Laravel to do the necessary writing and logging to the directories. If you ever experience blank pages on a fresh installation of Laravel, it is most likely due to incorrect permissions of your Laravel directories. Sometimes, SELinux is preventing Laravel from doing certain operations. So remember to always check your permissions if that ever happens!<\/p>\n<p>Allow .htaccess rewrite so that Laravel will be able to display clean urls. <\/p>\n<p>Open up your Apache configuration file and edit it<\/p>\n<pre>sudo vi \/etc\/httpd\/conf\/httpd.conf<\/pre>\n<p>Find the following line in your configuration file<\/p>\n<pre>\r\n&lt;Directory \/var\/www\/html &gt;\r\n\tOptions Indexes FollowSymLinks\r\n\tAllowOverride None\r\n\tRequire all granted\r\n&lt;\/Directory&gt;\r\n<\/pre>\n<p>and change it to<\/p>\n<pre>\r\n&lt;Directory \/var\/www\/html &gt;\r\n\tOptions Indexes FollowSymLinks\r\n\tAllowOverride All\r\n\tRequire all granted\r\n&lt;\/Directory&gt;\r\n<\/pre>\n<p><a href=\"https:\/\/i0.wp.com\/woohuiren.me\/blog\/wp-content\/uploads\/2015\/11\/httpd.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/woohuiren.me\/blog\/wp-content\/uploads\/2015\/11\/httpd.jpg?resize=676%2C426&#038;ssl=1\" alt=\"httpd\" width=\"676\" height=\"426\" class=\"alignnone size-full wp-image-424\" srcset=\"https:\/\/i0.wp.com\/woohuiren.me\/blog\/wp-content\/uploads\/2015\/11\/httpd.jpg?w=676&amp;ssl=1 676w, https:\/\/i0.wp.com\/woohuiren.me\/blog\/wp-content\/uploads\/2015\/11\/httpd.jpg?resize=300%2C189&amp;ssl=1 300w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><br \/>\nIt is not really recommended to edit your Apache configuration file with the above mentioned method but it is good enough for a small project. <\/p>\n<p>And that&#8217;s it! It&#8217;s really that simple. <\/p>\n<p>If you still encounter issues with installing or running Laravel 5 on Fedora, please feel free to leave your questions in the comment section below!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I&#8217;ve encountered some issues with installing Laravel 5 on Fedora and finally resolved all of them. I have decided to make this blog post just for you so that I can share the knowledge and experience I have gained with you. Please note that this guide is not recommended for production purposes as I &hellip; <a href=\"https:\/\/woohuiren.me\/blog\/installing-laravel-5-on-fedora\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Installing Laravel 5 on Fedora&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":422,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[119,2,4,5],"tags":[105,104,107,106,30],"class_list":["post-411","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fedora","category-information-technology","category-it-softwares","category-programming","tag-fedora","tag-laravel-5","tag-laravel-5-installation","tag-linux","tag-php"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/woohuiren.me\/blog\/wp-content\/uploads\/2015\/11\/main.jpg?fit=1920%2C1080&ssl=1","_links":{"self":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts\/411"}],"collection":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/comments?post=411"}],"version-history":[{"count":13,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts\/411\/revisions"}],"predecessor-version":[{"id":513,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts\/411\/revisions\/513"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/media\/422"}],"wp:attachment":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/media?parent=411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/categories?post=411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/tags?post=411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}