Create database mysql raspberry pi2/11/2024 ![]() You need to restart Apache to add this functionality: The second package adds the possibility to use MySQL functions in your PHP code (like the link between Apache and PHP). The first package (mariadb-server) installs the main server for your MySQL databases. Sudo apt install mariadb-server php-mysql The last component is MySQL, and again we’ll install it with APT: Move to the next section if you need to use MySQL too. If you see this page, everything is OK, Apache and PHP servers are installed correctly, and you can use HTML and PHP code in your pages. This should display something like this:.This is a basic PHP function to display PHP configuration in the browser. Once PHP installed, we should check that everything is fine with our installation before going further.įollow these steps to create a PHP file and test it in your browser: The second one supercharges Apache with PHP capability, allowing us to put PHP code in our HTML pages. ![]() The first one adds the core packages for PHP and the possibility to run PHP scripts in a terminal. To install PHP, we need to add two packages: The next step is to install PHP to add dynamic content capabilities to our web server. You need administrator privileges to do this, so make sure to use “sudo” as a prefix for all of your commands ( more details here).Īnother option is to remove this page and just upload the files you want to share in this folder.įor example, if you just need to share files on your network, remove the index.html and put your files directly in /var/www/html, Apache will automatically generate a web page with links to each one. You can edit index.html to change this page or add new pages in the same folder. ![]() Īs you can see in this page content, web pages are located under /var/www/html on the Raspberry Pi.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |