Currently Viewing Posts Tagged php.ini

PHP – Parse error: syntax error, unexpected end of file

FastCGI sent in stderr: “PHP message: PHP Parse error: syntax error, unexpected end of file in /your_path/yourscript.php on line 308” while reading response header

This is the error when I check the php log file. Because I met the blank page with 500 internal error, which is loaded OK on the other server.

The real reason is I use (<? ?> ) and (<?php ?>) in mix. So I faced with this parse error when running the script on different systems:

Parse error: syntax error, unexpected $end in X on line Y

where X is the file path and Y the line number, usually the last line of the file. But the shotform may not there.

To avoid this error, refrain yourself from using the short form and stick to ( <?php ?>), despite the extra 3 characters. This will make your code universally accessible and it is essential if your developing for beyond your own personal use. If you insist in using the short form (<? ?> ), and you get this error, you can enable the short form option in the php.ini file.


Keep in mind though, that the short form is supposed to be deprecated in PHP 6. If this goes through you will have to go back and change all your source files.


In the furture, I wil keep using long form of it only.

Custom PHP.INI on Dreamhost PS

To use custom PHP.ini on DreamhostPS or Dreamhost VPS, I did a lot of research. Actually search, or Google.
When I working on the Dreamhost Virtual hosting, I get the answer from Wiki of Dreamhost. But there are not enough information of PS on it.
The best answer from Google is here, from Dreamhost Scripts and Tips.

Continue reading “Custom PHP.INI on Dreamhost PS”

Upload file with socket enabled

I have a website, which allow user to upload large file. Such as 200MB flv file through WEB interface. This kind of upload is not use FTP, not the regular php upload function, or get, post form function. The large file has to use socket to upload.
It need socket enabled on PHP.
I do have the –enable-sockets configuration on PHP.

The problem is happened when I upload the big file, it is always stopped or died on certain parts. About 4MB size.
I think it must be time out of php script.
Later I found a directive called
The default value is 60. It means 60 seconds.

Continue reading “Upload file with socket enabled”

  • Archives