Sie sind auf Seite 1von 2

Installing Apache, PHP and MySQL for your Raspberry Pi web server

step_1 : sudo apt-get update

1.sudo bash

2.sudo apt-get install apache2 apache2-doc apache2-utils

3.sudo apt-get install libapache2-mod-php5 php5 php-pear php5-xcache

4.sudo apt-get install php5-mysql

5.sudo apt-get install mysql-server mysql-client

#During this installation, you will be asked for a password for the server.
# Enter a password that you will remember. Thats it! You have completed the first
step! Now reboot the pi.

#Testing the installed packages on our Raspberry Pi

step_2 : localhost 127.0.0.1 pi webserver

#importance
sudo nano /var/www/html/index.html

edit on python code

<p>it work<p>

ctrl+x save y and enter

root@raspberrypi:~#cd /var/www/html
root@raspberrypi: /var/www/html ~#sudo rm index.html

create sudo nano index.php

root@raspberrypi: /var/www/html ~#sudo leafpad index.php

edit php code

<?php echo "hello world"; ?>

sample code

exec('sudo python /var/www/gpio/ultrasonic.py');


$myfile = fopen("/var/www/gpio/ultra.txt", "r");
echo fread($myfile,filesize("/var/www/gpio/ultra.txt"));
fclose($myfile);
-----------------------------------------------------------------------------------
---
#phpMyAdmin: CONNECTION FOR CONTROLUSER AS DEFINED IN YOUR CONFIGURATION FAILED

nano /etc/phpMyAdmin/config-db.php

edit php cmd;

$dbuser='root';
$dbpass='root'; // set current password between quotes ' '
$basepath='';
$dbname='phpmyadmin';
$dbserver='';
$dbport='';
$dbtype='mysql';

#phpmysql server login

user name : root


password : root

select->new->create database->wordpress->loading

Das könnte Ihnen auch gefallen