{"id":555,"date":"2012-10-18T13:15:16","date_gmt":"2012-10-18T13:15:16","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=555"},"modified":"2025-04-26T18:26:54","modified_gmt":"2025-04-26T17:26:54","slug":"phpapache","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/software_utilities\/web-servers\/phpapache","title":{"rendered":"PHP\/Apache"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Installing&nbsp;PHP\/Apache<\/h4>\n\n\n\n<p>See <a href=\"https:\/\/raspberry-projects.com\/pi\/pi-operating-systems\/ubuntu-servers\/install-apache-php-and-mysql\">our page here<\/a>, works with Raspberry Pi OS too<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\nAdding Your HTML, PHP etc Files<br>\n<\/h4>\n\n\n\n<p>\nCopy them into the &#8220;\/var\/www\/html\/&#8221; directory.\n<\/p>\n\n\n\n<p>\nYou will need root permission to write to this directory, so if you are using the GUI file manager use &#8220;sudo su&#8221; to elevate yourself to the root user before starting the GUI with &#8220;startx&#8221;\n<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\nRestarting Apache<br>\n<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\nsudo service apache2 restart\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\nChange The Password!<br>\n<\/h4>\n\n\n\n<p>\nIf your RPi&nbsp;will be connected to the internet or a public network a&nbsp;priority is to make the Raspberry Pi more secure by not using the&nbsp;default username and password. To change the password for the pi user after logging in:\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\npasswd\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\nPerformance Tuning<br>\n<\/h4>\n\n\n\n<p>\nIf you are not using the HDMI out it is sensible to reduce&nbsp;the amount memory given to the RPi graphics to say 16MB using the config tool:\n<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\nThe configuration file<br>\n<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\nsudo nano \/etc\/apache2\/sites-enabled\/000-default.conf\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\nsudo raspi-config\n<\/code><\/pre>\n\n\n\n<p>\n&nbsp;\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing&nbsp;PHP\/Apache See our page here, works with Raspberry Pi OS too Adding Your HTML, PHP etc Files Copy them into the &#8220;\/var\/www\/html\/&#8221; directory. You will need root permission to write to this directory, so if you are using the GUI file manager use &#8220;sudo su&#8221; to elevate yourself to the root user before starting the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-555","post","type-post","status-publish","format-standard","hentry","category-web-servers"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=555"}],"version-history":[{"count":29,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/555\/revisions"}],"predecessor-version":[{"id":3917,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/555\/revisions\/3917"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}