PHP error in server logs

Home Forums BulletProof Security Pro PHP error in server logs

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #6791
    J Garner
    Participant

    Hi there,

    I just checked my error logs and have numerous occurrences of :

    [Sat Jun 08 15:26:56 2013] [error] [client [removed_IP]] PHP:  syntax error, unexpected $end, expecting ']' in /[removed_path]/www/php.ini on line 19, referer: [removed_domainname]
    [Sat Jun 08 15:26:57 2013] [error] [client [removed_IP]] PHP:  syntax error, unexpected $end, expecting ']' in /[removed_path]/www/php.ini on line 19

    Any idea what this could be, because line 19 in the php.ini file when I open it up is this:
    [To comment out a php.ini Directive you would add a semi-colon ; in front of the Directive – to uncomment remove the semi-colon]

    Thanks,

    John

    #6792
    AITpro Admin
    Keymaster

    Check above or below line 19.  All help comments should be enclosed in square brackets [ and ].  Or you can comment out entire lines by adding a semi-colon ;

    Example:

    ;[To comment out a php.ini Directive you would add a semi-colon ; in front of the Directive – to uncomment remove the semi-colon]
    ;[You can also use the left and right square brackets that are being used for all of this Help information within this file]
    ;[If a directive is commented out or the value is not specified then that Directive will use your Server default php.ini settings]
    ;[If your host does not allow you to change certain Directives in your custom php.ini file then you will not see any changes…]
    ;[…when you view phpinfo to see your PHP server configuration settings. Changes to your php.ini file could take up to 15 minutes to be seen…]
    ;[…or go into effect, but usually will not take more than 5 minutes for your changes to take effect.]
    ;[To view your websites php.ini settings – Go the php.ini Security Status page and also the PHP Info Viewer page]

    #6793
    J Garner
    Participant

    Well I just deleted that line 19 in the php.ini file and I’m still getting the error. What should I be looking for that is leading to this?

    Thanks

    #6794
    J Garner
    Participant

    So each line (that is a comment) should have a “;” at the beginning like your example above?

    #6795
    AITpro Admin
    Keymaster

    You would be looking for a syntax error (invalid code or commented out text) Make sure you turn Off autorestore and then rename the php.ini file to php.ini-BAK.  Do the Server log errors stop?

    #6796
    AITpro Admin
    Keymaster

    If you want to comment out entire lines of help text or if you want to comment anything at all the semi-colon ; means comment this out in a php.ini file.  In htaccess code use the pound sign # to comment out text or code.  In php code (and AS3, javascript, jQuery…) you can use the pound sign #, double slashes // or slash asterisk /*  text or code */ to comment out text or code.

    #6801
    J Garner
    Participant

    I’ve just checked and my wordpress set-up allows up to 256M files but in my php.ini file I see the limit is set at 64M. I guess that means that another PHP config file is defining the limit elsewhere on my server before the php.ini kicks in?

    #6802
    AITpro Admin
    Keymaster

    Custom php.ini file setup is very complex and there are many factors and variables – there is no one size fits all with custom php.ini files like with htaccess files.  ie there are 1,000’s of different hosts, then there are different versions of php, then there are many other factors to consider.  Is your web host listed in this web host list?  http://www.ait-pro.com/aitpro-blog/3576/bulletproof-security-pro/custom-php-ini-faq/#web-hosts-list

    If so, then you next need to take into consideration the php version that is installed on your server and then maybe you can use a custom php.ini file or not.  Things became very complicated with custom php.ini files when php5.3.x was released.

    Run the P-Security Diagnostic Checks/Recommendations tool and post the results.  If you are lucky you can use automation to create a custom php.ini file for your website.  If you are unlucky then you will have to do everything manually or you just will not be able to create a custom php.ini file for your website.  It is all up in the air these days after PHP5.3.x was released.

     

    #6805
    AITpro Admin
    Keymaster

    Based on the results of your Diagnostic check the problem is with your Server’s php.ini file and not your custom php.ini file.  Your custom php.ini file is actually being completely ignored.  Since you have PHP5.3.x you will need to follow the instructions in this Forum topic link below.  Basically you will need to contact your Host and find out what their specific Server requirements are for custom php.ini files.  Each web host is completely different and since your host is not in the web host list then we do not have any custom php.ini information for your host.

    http://forum.ait-pro.com/forums/topic/custom-php-ini-file-setup-php5-3-x/

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.