 <p>I think you have to put all your functions inside your class file</p> <pre><code> Class resize { private $image; private $width; private $height; private $imageResized; function __construct($fileName) { // *** Open up the file $this-&gt;image = $this-&gt;openImage($fileName); // *** Get width and height $this-&gt;width = imagesx($this-&gt;image); $this-&gt;height = imagesy($this-&gt;image); } // All other functions here ... } </code></pre>