Warning

If it is not explicitly told in following recipe, setting up services are described for Ubuntu 20.04 server, but applications are described for Xubuntu 20.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

PHP un MySQL atbalsts Apache serverī

Saturs

PHP dzinēja uzstādīšana

  1. Izpilda komandas:

    sudo apt-get install php libapache2-mod-php
    sudo a2enmod php7.4
    sudo /etc/init.d/apache2 restart
  2. Ja nepieciešams, kā root lietotājs papildina /etc/apache2/mods-available/dir.conf failā noklusēti izpildāmo failu sarakstu, iegūstot sekojošu:

    <ifmodule mod_dir.c>
     DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml
    </ifmodule>
  3. Pārstartē Apache:

    sudo /etc/init.d/apache2 restart

MySQL moduļa uzstādīšana

  1. Izpilda komandas:

    sudo apt-get install php-mysql
    sudo /etc/init.d/apache2 restart

Iestatījumu pārbaude

  1. Izveido failu /var/www/info.php, kurā izveido failu index.php ar sekojošu saturu:

    <?php
    phpinfo();
    ?>
  2. Atver URL adresi http://localhost/php/index.php. Vajadzētu atvērties sekojošam diagnostikas ekrānam.

    Kļūdu novēršana

    Ja nevar augšuplādēt failus, kuri lielāki par 16MB, izmaina faila /etc/php/7.4/apache2/php.ini rindas, piemēram, uz 100MB:

    ...
    post_max_size = 100M
    upload_max_filesize = 100M
    ...

 
 
Tags Tīmeklis Serveris
Created by Valdis Vītoliņš on 2008-08-09 11:05
Last modified by Valdis Vītoliņš on 2025-05-18 17:21
XWiki Powered
Creative Commons Attribution 3.0 Unported License