PHP Codes and Errors



Upload Codes
UPLOAD_ERR_OK the file uploaded with success
UPLOAD_ERR_INI_SIZEuploaded file exceeds the upload_max_filesize listed in the php.ini
UPLOAD_ERR_FORM_SIZE uploaded file exceeds the MAX_FILE_SIZE directive specified in the HTML form
UPLOAD_ERR_PARTIALuploaded file was only partially uploaded
UPLOAD_ERR_NO_FILEno file was uploaded
UPLOAD_ERR_NO_TMP_DIR a temporary folder is missing
UPLOAD_ERR_CANT_WRITE failed to write file to disk
UPLOAD_ERR_EXTENSION file upload stopped because of the extension

Look for these Key Clues
failed to open stream: No such file or directoryWhatever file is being called, it either does not exist or the pathway to the file was incorrectly entered.
file.php on line xxxThe error being encountered is in file.php specifically on line xxx
Fatal error: Call to undefined functionThe function being called is not supported. It may be turned off, commented out, or you may need to upload the library/script for it.
Parse error: parse error, unexpectedSyntax error, usually resulting from a missing semi-colon ; , or close parenthesis ) at the end of the line of code, or from the end of the preceeding line of code. This may also occur if there are whitespaces.
Warning: fsockopen(): unable to connect tofopen is not enabled. Many hosting companies have closed fopen due to a recent security risk. It is also possible that the DNS for that website can not be found by the internet at this time or it is refusing the connection.

Real Life examples Explained
PHP Warning: Cannot modify header information - headers already sent by (output started at /htdocs/internet/netquery/nquser.php:10) Headers are being sent more than once. Line 10 in the file nquser.php is sending out another set of headers. This can also be caused by whitespaces after or before the opening and closing php tags.
PHP Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /htdocs/internet/netquery/nquser.php:10) Line 10 in the file nquser.php is trying to send out a second set of headers.
PHP Fatal error: Allowed memory size of 159863725 bytes exhaustedMemory limit was reached. This can be changed in the php.ini file with memory_limit
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /htdocs/internet/netquery/nquser.php on line 29There is a syntax error on line 29 of the file nquser.php. The start and end of echo had a " (double quote), where PHP syntax uses a ' (single quote), instead. A " is only used within the command, ' is to start and end. example: echo ' <a href="howtointernet.net/netquery">Web Tech Page</a>';
PHP Fatal error: [Zend Optimizer] Zend Optimizer 3.2.0 is incompatible with XCache 1.2.0 in Unknown on line 0The two applications- Zend Optimizer and XCache are either not compatible or incorrectly configured together
Premature end of script headers: /htdocs/internet/netquery/index.phpIt is not able to finish reading the headers supplied on the file index.php
Fatal error: Maximum execution time of 0 seconds exceeded in /htdocs/internet/netquery/index.php on line 51Look to change the max_execution_time = and/or max_input_time = value. 0 can be set for unlimited.
Warning: main(): Failed opening 'nquser.php' for inclusion (include_path='') in /htdocs/internet/netquery/index.php on line 61The include being called could not be found because it does not exist or could not be opened due to permissions.
Warning: main(start.php): failed to open stream: No such file or directory in /htdocs/internet/netquery/index.php on line 73Either the file does not exist, or the code has the wrong path to that file. The file it is unable to find is start.php and the line of code defining the path to that file is on line 73 in the file index.php.
Warning: main(/home/htdocs/internet/netquery/file.php) [function.main]: failed to open stream: No such file or directory in /home/htdocs/internet/netquery/index.php on line 110Again the directory or file being called either does not exist or the pathway to the intended file is not properly set. The requested file to open is file.php the path listed for that file is /home/htdocs/internet/netquery/file.php and the line of code calling that file is on index.php line 110.
Fatal error: Call to unsupported or undefined function page_open()This usually occurs when using an older version of PHP script. If the PHP support on your server is a newer version, it is not fully backwards compatible much of the syntax has changed. It will also occur when a php function is not supported. It may be set to Off or commented out. You can check by using a phpinfo scipt. <?php phpinfo(); ?> You may also just need to install the library for that function.
Fatal error: Call to undefined function mysql_connect()The function is not currently installed. The mysql.so extension library does not come with the PHP or MySQL distributions. It must be installed separately.
Warning: fsockopen(): unable to connect to howtointernet.net in /home/htdocs/internet/netquery/file.php on line 63fopen is not enabled. Many hosting companies have closed fopen due to a recent security risk. It is also possible that the DNS for that website can not be found by the internet at this time or the server being called is refusing the connection. If you have access to your php.ini file check for allow_url_fopen =
Warning: require() [function.require]: URL file-access is disabled in the server configuration in /home/htdocs/open.php on line 12
Warning: require(http://howtointernet.com/includes/play.php) [function.require]: failed to open stream: no suitable wrapper could be found in /home/htdocs/open.php on line 12
Fatal error: require() [function.require]: Failed opening required 'http://howtointernet.com/includes/play.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/htdocs/open.php on line 12
fopen is not enabled. Many hosting companies have closed fopen due to a recent security risk. If you have access to your php.ini file check for allow_url_fopen = and allow_url_include =
Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:25 (Connection timed out) in /home/htdocs/sendmail.php on line 173 Port 25 may be closed, many places use a different port for mail servers. The email may not be on localhost (127.0.0.1), it may be on another server. This is especially true of hosting providers that use a server farm type of set up. The mail server may be down/turned off.

This page is still under construction