leaving xampp

For many years I used xampp (for Linux: Lampp), because of its simplicity, unlike the “native” Linux apache/php/mysql apps, wich seemed to me very difficult to configure.

The pro of xampp is its simplicity (with few mouse clicks you can do all to install and configure your local php/mysql sever). But the con is that your xampp apps don’t are updated regularly, and there can raise conflicts with Linux “native” mysql.

Therefore I decided to learn how to configure “native” (system-rooted, so to say) apache/php/mysql apps. I chose to install mariadb and not mysql.

And in these last weeks I managed to configure the server, with the following steps:

  • sudo apt install -y apache2
  • sudo apt install -y php
  • sudo apt install mariadb*
  • sudo mysql_secure_installation
  • sudo mysql -u root -p (and within >mysql shell
    • use mysql
    • GRANT ALL PRIVILEGES ON . TO 'root'@'localhost' WITH GRANT OPTION;
    • SHOW GRANTS FOR 'root'@localhost; //to check if it is all right
    • FLUSH PRIVILEGES;
    • exit;
  • sudo systemctl enable mariadb.service

start boot service in Linux

  1. Run this command
    sudo nano /etc/systemd/system/YOUR_SERVICE_NAME.service
  2. Paste in the command below. Press ctrl + x then y to save and exit
    [Unit]
    Description=lampp
     
    [Service]
    ExecStart=/opt/lampp/lampp start
    ExecStop=/opt/lampp/lampp stop
    Type=forking
     
    [Install]
    WantedBy=multi-user.target
  3. Reload services
    sudo systemctl daemon-reload
  4. Enable the service
    sudo systemctl enable YOUR_SERVICE_NAME
  5. Start the service
    sudo systemctl start YOUR_SERVICE_NAME
  6. Check the status of your service
    systemctl status YOUR_SERVICE_NAME
  7. Reboot your device and the program/script should be running. If it crashes it will attempt to restart

localhost: connessione non riuscita e altro

Non si tratta di permessi, né di files di configurazione. Ho risolto reinstallando lampp (o meglio istallandone una nuova versione).
Da notare che bisogna salvare l’installer di lampp (se si ha linux) su una partizione linux, altruimenti non parte.

Tabella corrotta, secondo l’ultima versione di MariaDB: si veda http://stackoverflow.com/questions/26871926/mariadb-mysql-database-table-corrupt-cant-repair.
In particolare funziona il “REPAIR TABLE myTable USE_FRM;”

Lampp: attenti al nuovo

Nell’ultima versione di Lampp (vedi apache-friends) ci sono due scogli da superare, lavorando sul file php.ini
1) un problema di avvisi (fastidiosi) sulla mancata definizione di variabili
(lo si risvolve aggiungendo una stringa nel file php.ini:
alla riga error_reporting = E_ALL | E_STRICT
si aggiunga “& ~E_NOTICE”, così che risulti
error_reporting = E_ALL | E_STRICT & ~E_NOTICE

2) altro errore interfacciandosi con Mysql, dà diversi errori di PDO. Si risolve aggiungendo alla stringa “pdo_mysql.default_socket=”
il luogo dove si trova il socket, nel caso di lampp “/opt/lampp/var/mysql/mysql.sock”. Così ne risulta la riga:
“pdo_mysql.default_socket=/opt/lampp/var/mysql/mysql.sock”

Indispensabili i forum su web. Assente la documentazione del produttore 🙁