Elenet.net
0 voti
Vorrei spiegato che cosa è e a cosa serve questo software.
quesito posto 18 Maggio 2017 in Classe quinta da Christian Gritto Corsista (117 punti)
  

2 Risposte

0 voti
Ecco un tutorial

risposta inviata 24 Maggio 2017 da Gianni Messina Esperto (736 punti)
0 voti

Easyphp consente di mettere su in pochi minuti un server "apache" comprensivo di componente php, ed un server mysql, nonchè un server "ftp", per il caricamento degli script del sito che vogliamo far girare; è uno tra i più noti, anche se ci sono alternative gratuite quali ad  esempio:

  • wamp
  • lamp (per il mondo linux)
  • xampp

fatta l'installazione del pacchetto, può risultare utile fare qualche "personalizzazione" alla configurazione fornita di default, tale operazione va fatta accedendo a file di testo, in cui sono presenti:

  • direttive ciascuna con il proprio valore
  • parti testuali prorpiamente dette, che si riconoscono dal carattere ";" iniziale che indica un commento, atte a spiegare la funzione delle direttive stesse, nonchè i possibili valori

a titolo di esempio vediamo un frammento del file php.ini:

; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It is
; generally recommended that <?php and ?> should be used and that this feature
; should be disabled, as enabling it may result in issues when generating XML
; documents, however this remains supported for backward compatibility reasons.
; Note that this directive does not control the <?= shorthand tag, which can be
; used regardless of this directive.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = Off

la direttiva "short_open_tag" attiva o disattiva la possibilità di usare "<?" come tag di apertura dei frammenti scritti in php.

 

risposta inviata 24 Maggio 2017 da tonins Corsista (123 punti)
;;;;;;;;;;;;;;;;;;;
; 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 = 120

la direttiva "max_execution_time" fissa un limite espresso in secondi per il tempo di esecuzione di uno script, molto utile per esempio in presenza di cicli infiniti.

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

; This directive informs PHP of which errors, warnings and notices you would like
; it to take action for. The recommended way of setting values for this
; directive is through the use of the error level constants and bitwise
; operators. The error level constants are below here for convenience as well as
; some common settings and their meanings.
; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
; those related to E_NOTICE and E_STRICT, which together cover best practices and
; recommended coding standards in PHP. For performance reasons, this is the
; recommend error reporting setting. Your production server shouldn't be wasting
; resources complaining about best practices and coding standards. That's what
; development servers and development settings are for.
; Note: The php.ini-development file has this setting as E_ALL. This
; means it pretty much reports everything which is exactly what you want during
; development and early testing.
;
; Error Level Constants:
; E_ALL             - All errors and warnings (includes E_STRICT as of PHP 5.4.0)
; E_ERROR           - fatal run-time errors
; E_RECOVERABLE_ERROR  - almost fatal run-time errors
; E_WARNING         - run-time warnings (non-fatal errors)
; E_PARSE           - compile-time parse errors
; E_NOTICE          - run-time notices (these are warnings which often result
;                     from a bug in your code, but it's possible that it was
;                     intentional (e.g., using an uninitialized variable and
;                     relying on the fact it's automatically initialized to an
;                     empty string)
; E_STRICT          - run-time notices, enable to have PHP suggest changes
;                     to your code which will ensure the best interoperability
;                     and forward compatibility of your code
; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
;                     initial startup
; E_COMPILE_ERROR   - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR      - user-generated error message
; E_USER_WARNING    - user-generated warning message
; E_USER_NOTICE     - user-generated notice message
; E_DEPRECATED      - warn about code that will not work in future versions
;                     of PHP
; E_USER_DEPRECATED - user-generated deprecation warnings
;
; Common Values:
;   E_ALL (Show all errors, warnings and notices including coding standards.)
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices)
;   E_ALL & ~E_NOTICE & ~E_STRICT  (Show all errors, except for notices and coding standards warnings.)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; http://php.net/error-reporting
error_reporting = E_ALL

la direttiva "error_reporting" consente di fissare il livello di errore che sarà riportato nel file di log del php.

; This directive controls whether or not and where PHP will output errors,
; notices and warnings too. Error output is very useful during development, but
; it could be very dangerous in production environments. Depending on the code
; which is triggering the error, sensitive information could potentially leak
; out of your application such as database usernames and passwords or worse.
; It's recommended that errors be logged on production servers rather than
; having the errors sent to STDOUT.
; Possible Values:
;   Off = Do not display any errors
;   stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
;   On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = On

la direttiva "display_errors" consente di fissare il livello di errore che sarà visibile all'utente finale quando il sito web è in funzione.

tipiacamente quando il sito web è in produzione, si setta su "Off", come si può vedere qualche riga più in alto.

Domande correlate

0 voti
7 risposte
quesito posto 26 Settembre 2014 in Classe quinta da Emanuele Rizzo Esperto (238 punti) | 1,508 visite
0 voti
0 risposte
quesito posto 30 Marzo 2023 in Classe quarta da davide_virzi (19 punti) | 79 visite
0 voti
0 risposte
quesito posto 30 Marzo 2023 in Classe quarta da davide_virzi (19 punti) | 62 visite
778 domande
1,565 risposte
639 commenti
1,445 utenti