@laravista puoi controllare la variabile attraverso prefisso REDIRECT_ https://httpd.apache.org/docs/2.4/re...tml#setenvvars
Per rimuovere /index.php/ (PATHINFO) e usare la riscrittura (mod_rewrite)
Codice:
Options +FollowSymLinks -Indexes
RewriteEngine On
# # this root / this path root /mypath/
RewriteBase /
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
Dovrai aggiungere RewriteBase /mypath/ con il nome della directory dove risiede ogni file .htaccess (per root imapp RewriteBase /imapp/ per root imapp/public RewriteBase /imapp/public/) per mod_rewrite questa è la root / mentre per i file che risiedono in altervista è /membri/nickname (eccetto file temporanei che potrebbero avere percorsi impostati diversamente, ad esempio la cartella temporanea per l'upload).
File env per nickname altervista https://github.com/vlucas/phpdotenv
Codice:
BASE_DIR="/membri/nickname/project-root" # or /membri2/nickname/project-root
CACHE_DIR="${BASE_DIR}/cache"
TMP_DIR="/membri/.dummy/temp"
APP_ENV=production
APP_DIR="/membri/nickname/project-root"
APP_URL="http://nickname.altervista.org/project-root/public/index.php"
In /imapp/config/app.php cambia APP_ENV e APP_URL https://github.com/laravel/laravel/b...ig/app.php#L55
Ho usato il codice WordPress per recuperare la cartella temporanea altrimenti userà /tmp
Codice:
<?php
var_dump(get_temp_dir());
function untrailingslashit( $string ) {
return rtrim( $string, '/\\' );
}
function trailingslashit( $string ) {
return untrailingslashit( $string );
}
function win_is_writable( $path ) {
if ( '/' === substr($path, strlen( $path ) - 1 ) ) {
// If it looks like a directory, check a random file within the directory.
return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp' );
} elseif ( is_dir( $path ) ) {
// If it's a directory (and not a file), check a random file within the directory.
return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' );
}
// Check tmp file for read/write capabilities.
$should_delete_tmp_file = ! file_exists( $path );
$f = @fopen( $path, 'a' );
if ( false === $f ) {
return false;
}
fclose( $f );
if ( $should_delete_tmp_file ) {
unlink( $path );
}
return true;
}
function wp_is_writable( $path ) {
if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) {
return win_is_writable( $path );
} else {
return @is_writable( $path );
}
}
function get_temp_dir() {
static $temp = '';
if ( defined( 'WP_TEMP_DIR' ) ) {
return trailingslashit( WP_TEMP_DIR );
}
if ( $temp ) {
return trailingslashit( $temp );
}
if ( function_exists( 'sys_get_temp_dir' ) ) {
$temp = sys_get_temp_dir();
if ( @is_dir( $temp ) && wp_is_writable( $temp ) ) {
return trailingslashit( $temp );
}
}
$temp = ini_get( 'upload_tmp_dir' );
if ( @is_dir( $temp ) && wp_is_writable( $temp ) ) {
return trailingslashit( $temp );
}
$temp = WP_CONTENT_DIR . '/';
if ( is_dir( $temp ) && wp_is_writable( $temp ) ) {
return $temp;
}
return '/tmp';
}
https://laravel.com/docs/7.x
Per account altersito INNODB va attivato per la prima volta "unicamente" dal pannello di controllo altervista.