Tag Archives: php-errors

PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in C:apache2triadhtdocsimagedisplay.php on line 28

hi i am getting an error during my execution of the code : PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘,’ or ‘;’ in C:apache2triadhtdocsimagedisplay.php on line 28

<?php

$dir= "C:apache2triadhtdocsphppgadminimagesphpimages";

$file_display= array('jpg', 'jpeg', 'png', 'gif');

if(file_exists($dir)== false)
{
  

Continue reading

Tagged , | Leave a comment

php parse errors won't show

I’m running ubuntu 10.04 + nginx + php-fpm 5.4
If I set display_errors = On… in php.ini all errors are printed. If Instead I set that to off and then use ini_set(‘display_errors, ’1′); directly in the script they will show Continue reading

Tagged , | Leave a comment

how clear PHP startup warnings?

I have an shared host and wrote an php shell for get piped emails. this host always make an error log like this:

PHP Warning:  PHP Startup: Suhosin Extension does not officially support PHP 5.2 and below anymore, because it 

Continue reading

Tagged , | 2 Comments

Empty results with Where Clause

I have problem with showing results from “visits” table depending on search form !
here is the code !

                <?php

                $date1 = $_POST['day'] . "-" . $_POST['month'] . "-" . $_POST['year'];
                $date2 = $_POST['day1'] . "-" . $_POST['month1'] . "-" 

Continue reading

Tagged , , | 2 Comments

Prevent users from accessing admin area

Good Day,
am Facing a code error with my Admin control panel PHP page.
I want to prevent any other user from accessign this page unless his job_title= admin.
it works but even the admin himslef redirects back to login… Continue reading

Tagged , , | Leave a comment

PHP with APC: Fatal errors: Cannot redeclare class

Since I installed APC for PHP with PECL I get sometimes these errors: Cannot redeclare class xxx…
xxx changes from time to time. I could disable APC but APC improves the performance great! Is there a known bug or could Continue reading

Tagged , , , | 4 Comments

WordPress with Nginx + php5-fpm gives me strange 502 errors and recv() ready() failed

I have recently encountered a new kind of problem with my Nginx php5-fpm installation. I use it for a production website with a lot of members and traffic. The website basically exists of a wordpress blog (as cms and for… Continue reading

Tagged , , , , | 1 Comment

Why are PHP errors printed twice?

Summary
Amazingly I could find nothing about this on Google or SO. When I throw an exception in PHP it appears in my console twice, complete with error message and stack trace. The first time it’s printed it says “PHP… Continue reading

Tagged , , | Leave a comment

PHP Error handling: die() Vs trigger_error() Vs throw Exception

In regards to Error handling in PHP — As far I know there are 3styles

die()or exit() style:

$con = mysql_connect("localhost","root","password");

if (!$con) {
 die('Could not connect: ' . mysql_error());
}

throw Exception style:

 if (!function_exists('curl_init')) {

      throw new 

Continue reading

Tagged , , , | Leave a comment

When should I throw an exception as opposed to return an error in PHP?

I’m working on an API wrapper class, which is the first I’ve made.
For the most part it hasn’t been too difficult.
Getting to the point where I need to deal with the potential of errors being returned by the… Continue reading

Tagged , , , , | Leave a comment
2 pages