Web Entwicklung: Unterschied zwischen den Versionen

Aus Vosp.info
Wechseln zu:Navigation, Suche
(mysql)
(mysql)
Zeile 66: Zeile 66:
 
== mysql ==
 
== mysql ==
  
=== Datenbank&Benutzer anlegen
+
=== Datenbank&Benutzer anlegen ===
 
<source lang="bash">
 
<source lang="bash">
 
mysql -u root -p
 
mysql -u root -p

Version vom 4. Dezember 2013, 21:11 Uhr

apache

Installation

apt-get install mysql-server mysql-client apache2 php5 php5-mysql libapache2-mod-php5 phpmyadmin
/usr/bin/mysqladmin -u root password 'enter-your-good-new-password-here'
/etc/init.d/apache2 restart

Konfiguration für die Entwicklung

/etc/php5/apache2/php.ini

error_reporting = E_ALL & ~E_DEPRECATED
display_errors = On


php

pear

apt-get install php5-dev make php-pear

cairo

Installation

pecl install cairo
pecl install cairo channel://pecl.php.net/cairo-0.3.2
echo "extension=cairo.so" >>  /etc/php5/apache2/php.ini
/etc/init.d/apache2 restart

Beispiel

$s = new CairoImageSurface(CairoFormat::ARGB32, 400, 400);
$c = new CairoContext($s);
$c->fill();
$c->setSourceRGB(1, 0, 0);
$c->setLineWidth(50);
$c->arc(200, 200, 100, 0, 2 * M_PI);
$c->stroke();
$c->setSourceRGB(0, 0, 0.6);
$c->rectangle(0, 160, 400, 75);
$c->fill();
 
$s->writeToPng(dirname(__FILE__)  . '/test.png');

Probleme

falls das php nicht interpretiert wird, sondern stumpf ausgegeben wird

/etc/php5/apache2/php.ini da nicht "<?php" verwendet wird, muss der short_open_tag aktiviert werden!!!!

short_open_tag = On

mysql

Datenbank&Benutzer anlegen

mysql -u root -p
create database DATABASE;
create user 'USERNAME'@'localhost' identified by 'PASSWORD';
grant all on DATABASE.* to 'USERNAME'@'localhost';

export import

# export
mysqldump --single-transaction --default-character-set=utf8 -u _username_ -p _databasename_ > mysql.yyyymmdd.sql
# import
mysql -u _username_ -p _databasename_ < mysql.yyyymmdd.sql