Jump to content

Apache24 & PHP 7.1


tierrilopes
 Share

Recommended Posts

Executar os seguintes comandos, por ordem:

pkg update && pkg upgrade -y
pkg install -y apache24 php71 php71-extensions mod_php71 php71-mbstring php71-mcrypt php71-zlib php71-curl php71-gd php71-json php71-pdo_mysql php71-mysqli
sysrc apache24_enable="yes"

 

Ir até ao ficheiro:

/usr/local/etc/apache24/httpd.conf

Onde diz:

#ServerName www.example.com:80

Mudar para:

ServerName IP_SERVIDOR

Exemplo:
ServerName 123.123.123.123

 

Onde está:

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

Mudar para:

<IfModule dir_module>
    DirectoryIndex index.php index.html index.htm
</IfModule>

 

Onde está (para que ficheiros .htaccess funcionem e para ocultar visualização de pastas vazias):

DocumentRoot "/usr/local/www/apache24/data"
<Directory "/usr/local/www/apache24/data">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

 

Mudar para:

DocumentRoot "/usr/local/www/apache24/data"
<Directory "/usr/local/www/apache24/data">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options -Indexes +FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

 

Para terminar, adicionar o seguinte no final do ficheiro:

<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>

 

Para as mudanças terem efeito, reiniciar o servidor apache com o comando:

service apache24 restart

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...