PHP Error, Warning or Notice.

learn more… | top users | synonyms

222
votes
9answers
37k views

Headers already sent by PHP

When running my script I get several errors looking like this: Warning: Cannot modify header information - headers already sent by (output started at /some/file.php:12) in /some/file.php on line ...
51
votes
8answers
78k views

PHP: “Notice: Undefined variable” and “Notice: Undefined index”

I am running a PHP script, and keep getting errors like: Undefined variable: user_location in C:\wamp\www\mypath\index.php on line 12 Line 12 looks like this: $greeting = "Hello, ".$user_name." ...
102
votes
20answers
7k views

Reference - What does this error mean in PHP?

What is this? This is a number of answers about warnings, errors and notices you might encounter while programming PHP and have no clue how to fix. This is also a Community Wiki, so everyone is ...
5
votes
6answers
52k views

Call to a member function on a non-object

So I'm refactoring my code to implement more OOP. I set up a class to hold page attributes. class PageAtrributes { private $db_connection; private $page_title; public function ...
5
votes
1answer
989 views

The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead

When I attempt to connect to a MySQL server from PHP, I see the following error: Deprecated: The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in ...
62
votes
9answers
92k views

Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php

Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php any suggestion
28
votes
4answers
46k views

Invalid argument supplied for foreach()

It often happens to me to handle data that can be either an array or a null variable and to feed some foreach with these data. $values = get_values(); foreach ($values as $value){ ... } When you ...
25
votes
2answers
19k views

Call-time pass-by-reference has been deprecated;

I am getting the warning: Call-time pass-by-reference has been deprecated for the following lines of code. Please anybody help function XML(){ $this->parser = ...
7
votes
2answers
4k views

php regular expressions No ending delimiter '^' found in

I've been having some trouble with regular expressions, I don't know very much about regular expressions so bear with me. This is my code $numpattern = "^([0-9]+)$"; if (preg_match($numpattern, ...
21
votes
8answers
16k views

Pass by reference problem with PHP 5.3.1

Ok, this is a weird problem, so please bear with me as I explain. We upgraded our dev servers from PHP 5.2.5 to 5.3.1. Loading up our code after the switch, we start getting errors like: Warning: ...
1
vote
4answers
2k views

Undefined index in PHP [duplicate]

Possible Duplicate: PHP: “Notice: Undefined variable” and “Notice: Undefined index” Good day! I am having the following error in my code: <?php if (!$_POST['SUBMIT']){ //ERROR: ...
47
votes
1answer
37k views

PHP 5.4 Call-time pass-by-reference - Easy fix available?

Is there any way to easily fix this issue or do I really need to rewrite all the legacy code? PHP Fatal error: Call-time pass-by-reference has been removed in ... on line 30 This happens ...
10
votes
2answers
8k views

How to install imagemagick on windows 7

How to install image magic in Windows 7. I followed these instruction To install IMagick on Windows XP (php 5.2.x) download and install ImageMagick-6.5.8-7 Q16-windows-dll.exe ...
15
votes
5answers
21k views

Solution for “Fatal error: Maximum function nesting level of '100' reached, aborting!” in PHP

I have made a function that finds all the URLs within an html file and repeats the same process for each html content linked to the discovered URLs. The function is recursive and can go on endlessly. ...
3
votes
3answers
13k views

Delimiter must not be alphanumeric or backslash and preg_match

I have this code : $string1 = "My name is 'Kate' and im fine"; $pattern = "My name is '(.*)' and im fine"; preg_match($pattern , $string1, $matches); echo $matches[1]; and when im run it returns ...

1 2 3 4 5 7
15 30 50 per page