{"id":11875,"date":"2017-03-15T12:29:59","date_gmt":"2017-03-15T11:29:59","guid":{"rendered":"https:\/\/xlogic.org\/blog\/?p=11875"},"modified":"2026-08-01T14:25:31","modified_gmt":"2026-08-01T12:25:31","slug":"come-risolvere-gli-errori-comuni-php","status":"publish","type":"post","link":"https:\/\/xlogic.org\/blog\/come-risolvere-gli-errori-comuni-php.html\/","title":{"rendered":"Errori PHP comuni: diagnosi e correzione"},"content":{"rendered":"<p><!-- xlogic-seo-lotto50-2-20260801:11875 --><\/p>\n<div class=\"xlogic-direct-answer\">\n<p><strong>Gli errori PHP comuni si diagnosticano partendo dal messaggio completo, dal file e dalla riga indicata.<\/strong> Parse error, TypeError, fatal error, warning e notice hanno significati diversi; la correzione deve essere testata fuori produzione e accompagnata dal controllo dei log.<\/p>\n<p><em><strong>Nota di aggiornamento:<\/strong> Non mostrare errori dettagliati ai visitatori in produzione. Registra i messaggi nei log e abilita il debug visibile soltanto in un ambiente controllato.<\/em><\/p>\n<\/div>\n<h2>Informazioni aggiornate e controlli essenziali<\/h2>\n<p>Questo tutorial \u00e8 dedicato ai nostri clienti possessori di un <a href=\"https:\/\/xlogic.org\/vps-ssd\/\" target=\"_blank\" rel=\"noopener\">VPS<\/a> o di un <a href=\"https:\/\/xlogic.org\/server-dedicati\/\" target=\"_blank\" rel=\"noopener\">Server Dedicato<\/a> (unManaged).<\/p>\n<p>La compilazione PHP \u00e8 altamente personalizzabile, ma non \u00e8 un processo semplice e potrai incontrare qualche difficolt\u00e0.<\/p>\n<p>Di seguito ti elenchiamo\u00a0gli errori pi\u00f9 comuni PHP e le relative soluzioni:<\/p>\n<p><strong>ERRORE 1 :<\/strong><\/p>\n<p>checking for BZip2 support\u2026 yes<br \/>\nchecking for BZip2 in default path\u2026 not found<br \/>\nconfigure: error: Please reinstall the BZip2 distribution<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install bzip2-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 2 :<\/strong><\/p>\n<p>checking for cURL support\u2026 yes<br \/>\nchecking if we should use cURL for url streams\u2026 no<br \/>\nchecking for cURL in default path\u2026 not found<br \/>\nconfigure: error: Please reinstall the libcurl distribution &#8211;<br \/>\neasy.h should be in \/include\/curl\/<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install curl-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 3 :<\/strong><\/p>\n<p>checking for fabsf\u2026 yes<br \/>\nchecking for floorf\u2026 yes<br \/>\nconfigure: error: jpeglib.h not found.<\/p>\n<p>checking for fabsf\u2026 yes<br \/>\nchecking for floorf\u2026 yes<br \/>\nchecking for jpeg_read_header in -ljpeg\u2026 yes<br \/>\nconfigure: error: png.h not found.<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install libpng-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 4 :<\/strong><\/p>\n<p>checking for curl_multi_strerror in -lcurl\u2026 yes<br \/>\nchecking for QDBM support\u2026 no<br \/>\nchecking for GDBM support\u2026 no<br \/>\nchecking for NDBM support\u2026 no<br \/>\nconfigure: error: DBA: Could not find necessary header file(s).<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install db4-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 5 :<\/strong><\/p>\n<p>checking for png_write_image in -lpng\u2026 yes<br \/>\nIf configure fails try \u2013with-xpm-dir=<\/p>\n<p>configure: error: freetype.h not found.<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>Fix: Riconfigura PHP con le seguenti opzioni.<br \/>\n\u2013with-xpm-dir=\/usr<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 6 :<\/strong><\/p>\n<p>checking for png_write_image in -lpng\u2026 yes<br \/>\nconfigure: error: libXpm.(a|so) not found.<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install libXpm-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 7 :<\/strong><\/p>\n<p>checking for bind_textdomain_codeset in -lc\u2026 yes<br \/>\nchecking for GNU MP support\u2026 yes<br \/>\nconfigure: error: Unable to locate gmp.h<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install gmp-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 8 :<\/strong><\/p>\n<p>checking for utf8_mime2text signature\u2026 new<br \/>\nchecking for U8T_DECOMPOSE\u2026<br \/>\nconfigure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install libc-client-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 9 :<\/strong><\/p>\n<p>checking for LDAP support\u2026 yes, shared<br \/>\nchecking for LDAP Cyrus SASL support\u2026 yes<br \/>\nconfigure: error: Cannot find ldap.h<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install openldap-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 10 :<\/strong><\/p>\n<p>checking for mysql_set_character_set in -lmysqlclient\u2026 yes<br \/>\nchecking for mysql_stmt_next_result in -lmysqlclient\u2026 no<br \/>\nchecking for Oracle Database OCI8 support\u2026 no<br \/>\nchecking for unixODBC support\u2026 configure: error: ODBC header file \u2018\/usr\/include\/sqlext.h\u2019 not found!<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install unixODBC-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 11 :<\/strong><\/p>\n<p>checking for PostgreSQL support for PDO\u2026 yes, shared<br \/>\nchecking for pg_config\u2026 not found<br \/>\nconfigure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install postgresql-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 12 :<\/strong><\/p>\n<p>checking for sqlite 3 support for PDO\u2026 yes, shared<br \/>\nchecking for PDO includes\u2026 (cached) \/usr\/local\/src\/php-5.3.7\/ext<br \/>\nchecking for sqlite3 files in default path\u2026 not found<br \/>\nconfigure: error: Please reinstall the sqlite3 distribution<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install sqlite-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 13 :<\/strong><\/p>\n<p>checking for utsname.domainname\u2026 yes<br \/>\nchecking for PSPELL support\u2026 yes<br \/>\nconfigure: error: Cannot find pspell<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install aspell-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 14 :<\/strong><\/p>\n<p>checking whether to enable UCD SNMP hack\u2026 yes<br \/>\nchecking for default_store.h\u2026 no<\/p>\n<p>checking for kstat_read in -lkstat\u2026 no<br \/>\nchecking for snmp_parse_oid in -lsnmp\u2026 no<br \/>\nchecking for init_snmp in -lsnmp\u2026 no<br \/>\nconfigure: error: SNMP sanity check failed. Please check config.log for more information.<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install net-snmp-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 15 :<\/strong><\/p>\n<p>checking whether to enable XMLWriter support\u2026 yes, shared<br \/>\nchecking for xml2-config path\u2026 (cached) \/usr\/bin\/xml2-config<br \/>\nchecking whether libxml build works\u2026 (cached) yes<br \/>\nchecking for XSL support\u2026 yes, shared<br \/>\nconfigure: error: xslt-config not found. Please reinstall the libxslt &gt;= 1.1.0 distribution<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install libxslt-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 16 :<\/strong><\/p>\n<p>configure: error: xml2-config not found. Please check your libxml2 installation.<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install libxml2-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 17 :<\/strong><\/p>\n<p>checking for PCRE headers location\u2026 configure: error: Could not find pcre.h in \/usr<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install pcre-devel<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 18 :<\/strong><\/p>\n<p>libtool: link: cannot find the library `\/usr\/lib\/libidn.la\u2019 or unhandled argument `\/usr\/lib\/libidn.la\u2019<br \/>\nmake: *** [sapi\/cgi\/php-cgi] Error 1<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>cd \/usr\/src\/<br \/>\nwget http:\/\/ftp.gnu.org\/gnu\/libidn\/libidn-1.26.tar.gz<br \/>\ntar -zvxf libidn-1.26.tar.gz<br \/>\ncd libidn-1.26<br \/>\n.\/configure<br \/>\nmake<br \/>\nmake install<br \/>\nln -s \/usr\/local\/lib\/libidn.la \/usr\/lib\/libidn.la<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 19 :<\/strong><\/p>\n<p>libtool: link: `\/usr\/lib\/libxml2.la\u2019 is not a valid libtool archive<br \/>\nmake: *** [ext\/xsl\/xsl.la] Error 1<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>cd \/usr\/src\/<br \/>\nwget ftp:\/\/xmlsoft.org\/libxml2\/libxml2-2.7.3.tar.gz<br \/>\ntar -zvxf libxml2-2.7.3.tar.gz<br \/>\ncd libxml2-2.7.3<br \/>\n.\/configure \u2013prefix=\/usr<br \/>\nmake<br \/>\nmake install<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 20 :<\/strong><\/p>\n<p>configure: error: Your t1lib distribution is not installed correctly. Please reinstall it.<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install t1lib-devel.x86_64<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 21:<\/strong><\/p>\n<p>configure: error: mcrypt.h not found. Please reinstall libmcrypt.<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install libmcrypt-devel.x86_64<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ERRORE 22 :<\/strong><\/p>\n<p>configure: error: Cannot find libtidy<\/p>\n<p><strong>Soluzione:<\/strong><\/p>\n<p>yum install libtidy libtidy-devel<\/p>\n<p>&nbsp;<\/p>\n<p>Alla Prossima.<\/p>\n<p>&nbsp;<\/p>\n<h2>Approfondimenti correlati<\/h2>\n<ul>\n<li><a href=\"https:\/\/xlogic.org\/blog\/errori-comuni-in-wordpress.html\/\">Errori comuni in WordPress: cause e soluzioni<\/a><\/li>\n<li><a href=\"https:\/\/xlogic.org\/blog\/comandi-utili-ssh.html\/\">Comandi utili SSH<\/a><\/li>\n<\/ul>\n<p><strong>Fonte ufficiale:<\/strong> <a href=\"https:\/\/www.php.net\/manual\/it\/errorfunc.constants.php\" target=\"_blank\" rel=\"noopener noreferrer\">Manuale PHP: livelli di errore<\/a>.<\/p>\n<h2>Domande frequenti<\/h2>\n<h3>Perch\u00e9 la riga indicata non \u00e8 sempre la causa?<\/h3>\n<p>Un errore di sintassi pu\u00f2 essere rilevato quando il parser incontra il token successivo. Occorre controllare anche le righe precedenti.<\/p>\n<h3>Come gestire gli errori in produzione?<\/h3>\n<p>Disabilita la visualizzazione pubblica, abilita logging sicuro, limita accesso ai log e monitora gli errori ricorrenti.<\/p>\n<h3>Un aggiornamento PHP pu\u00f2 creare errori?<\/h3>\n<p>S\u00ec. Funzioni deprecate, tipi pi\u00f9 rigorosi e incompatibilit\u00e0 di plugin o codice personalizzato possono emergere dopo il cambio versione.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Errori PHP comuni: scopri come leggere messaggio, file e riga, distinguere parse, warning, fatal error e notice e correggere il codice in sicurezza.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[5,1421],"tags":[1309,1093,1310,1308],"class_list":["post-11875","post","type-post","status-publish","format-standard","hentry","category-news","category-coding","tag-compilazione-php","tag-errori-php","tag-moduli-php","tag-ssh-php"],"modified_by":"Team tecnico Xlogic","_links":{"self":[{"href":"https:\/\/xlogic.org\/blog\/wp-json\/wp\/v2\/posts\/11875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xlogic.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xlogic.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xlogic.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xlogic.org\/blog\/wp-json\/wp\/v2\/comments?post=11875"}],"version-history":[{"count":0,"href":"https:\/\/xlogic.org\/blog\/wp-json\/wp\/v2\/posts\/11875\/revisions"}],"wp:attachment":[{"href":"https:\/\/xlogic.org\/blog\/wp-json\/wp\/v2\/media?parent=11875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlogic.org\/blog\/wp-json\/wp\/v2\/categories?post=11875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlogic.org\/blog\/wp-json\/wp\/v2\/tags?post=11875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}