PHP Zeug

Composer install on Linux

Download Composer and

sudo php composer-setup.php --install-dir=/usr/bin --filename=composer

Request Content mal anders

$put = array();
parse_str(file_get_contents('php://input'), $put);

short codes

if null:

$a = $b ?? '';

if empty

$a = $b ?: '';

allapow.user.ini

Die *.user.ini liegt in /etc/php – kann aber überall liegen.

Jede PHP Version soll sie benutzen – darum einen symbolischen Link erstellen:

sudo ln -s /etc/php/allapow.user.ini /etc/php/7.4/apache2/conf.d/allapow.user.ini

Inhalt:

;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 10M


;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 6M

; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 1200

; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = 60

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; display_errors
;   Default Value: On
;   Development Value: On
;   Production Value: Off
display_errors = Off

; error_reporting
;   Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
;   Development Value: E_ALL
;   Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
error_reporting = E_ALL

; log_errors
;   Default Value: Off
;   Development Value: On
;   Production Value: On
log_errors = On

[Session]
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
; http://php.net/session.gc-maxlifetime
; 86400 = 1 day
session.gc_maxlifetime = 86400

[Xdebug]
# zend_extension=xdebug.so # steht in der 20-xdebug.ini
# xdebug.mode=debug # xdebug 3.x - muss direkt in die 20-xdebug.ini | php.ini
xdebug.client_host=localhost
xdebug.client_port=9003
xdebug.start_with_request=yes
# xdebug.idekey=PHPSTORM # muss direkt in die 20-xdebug.ini | php.ini
# xdebug.discover_client_host=1 # muss direkt in die 20-xdebug.ini | php.ini