473,405 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Error accessing class files in php

Hello php group,

I have a dev server running php 5.0 and apache 2.2, I have created
some php files that create classes, etc All works well with this.

But when I copy the files to my hosting service's server - I get the
following error :
Parse error: parse error, unexpected T_CLASS in /home/3/2/2/3468/3468/
usr/include/classes/Portfolio.php on line 2.

I have a file called common.php which references the classes I have
made.
a snippet of code is:
<?php

require_once '/home/3/2/2/3468/3468/usr/include/classes/
Portfolio.php';
require_once '/home/3/2/2/3468/3468/usr/include/classes/
PortfolioImage.php';

?>

The error occurs at the first line in the class definition: it gives
me the error where I have the word "abstract"
<?php
abstract class Portfolio
{
public static $db;
public static $queries;
..... other functions, methods, etc

} //end of class def.

I also get the same type of error (moving the PortfolioImages.php file
to the first position in common.php)

snippet:
<?php
/***
18 March 2007 - Modified to use the portfolio table ,for insert of
portfolio image data
10 April 2007 - Copied the PortfolioImage.php class to a class for the
portfolio table
***/

class PortfolioImage
{
public $id;
public $folio; //same as "p"
public $pfolder; //same as folder
public $pname;
public $_tn_width;
public $_tn_height;
public $oheight;
public $owidth;

..... other functions, methods, etc

} //end of class def.

The above code gives the same parse error but as soon as it sees the
first variable definition, public $id, but on a different line number
(9).

I see where PHP 4.3 should support OOP type coding, etc. Is there
something that my hosting service needs to do??? or something I need
to do???

I have considerable time developing the code, and would hate to have
to re-write for my hosting server!! Any ideas on this??

thanks,

eholz1

Apr 29 '07 #1
3 1446
eholz1 kirjoitti:
Hello php group,

I have a dev server running php 5.0 and apache 2.2, I have created
some php files that create classes, etc All works well with this.

But when I copy the files to my hosting service's server - I get the

The error occurs at the first line in the class definition: it gives
me the error where I have the word "abstract"
<?php
abstract class Portfolio
{
public static $db;
public static $queries;
abstract was introduced in php 5. You can't get this code working on php
4 server without modifications. Contact your current host and ask if
they're offering php 5. If not, find another host. That is, unless you
want to rewrite the code to php 4 compatible.

FYI: OOP support in older php versions sucked until php 5.

--
Ra*********@gmail.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze
Apr 29 '07 #2
On Apr 29, 12:12 pm, Rami Elomaa <rami.elo...@gmail.comwrote:
eholz1 kirjoitti:
Hello php group,
I have a dev server running php 5.0 and apache 2.2, I have created
some php files that create classes, etc All works well with this.
But when I copy the files to my hosting service's server - I get the
The error occurs at the first line in the class definition: it gives
me the error where I have the word "abstract"
<?php
abstract class Portfolio
{
public static $db;
public static $queries;

abstract was introduced in php 5. You can't get this code working on php
4 server without modifications. Contact your current host and ask if
they're offering php 5. If not, find another host. That is, unless you
want to rewrite the code to php 4 compatible.

FYI: OOP support in older php versions sucked until php 5.

--
Rami.Elo...@gmail.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze
Hello all,

Hmmm, a good point! also I am using mysqli (for stored procedures).
I am in trouble now!
Thanks,
eholz

Apr 29 '07 #3
eholz1 wrote:
Hmmm, a good point! also I am using mysqli (for stored procedures).
I am in trouble now!
I would agree with Rami that the best solution is to upgrade your hosting
rather than downgrade your code!

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 30 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andrew Luke | last post by:
Hi all you C++ guru's! I'm 'very, very' new to C++ and I'm having a little trouble configuring my VS environment I think - when I try and compile some sample code I'm getting the following...
3
by: AdamM | last post by:
Hi all, When I run my VbScript, I get the error: "ActiveX component can't create object: 'getobject'. Error 800A01AD". Any ideas what I did wrong? Here's my VBScript: dim o set...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
0
by: Paul van Brenk | last post by:
Hi, after installing sp1 on windows 2003 I get the following error when accessing an aspx page in an otherwise asp application: error: Unable to generate a temporary class (result=1). error...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
5
by: ZWeng | last post by:
I created a windows service using FileSystemWatcher to moniter a folder for file drops. The service uses FileStream and StreamReader to read and process the file. After it is done, the file is...
21
by: Mark Rae | last post by:
Hi, I have an ASP.NET 2 web application (not web site) project and am using a web deployment project to deploy to the testing, then the production server. All has been working well for months...
10
by: sachinv1821 | last post by:
hi , i am Getting this Error fatal error C1189: #error : "eh.h is only for C++!" my Problem is i am Having C++ librabry and Appropriate .h file i want to Access Them is .c File Files..... to Be...
4
by: =?Utf-8?B?SmFzb24gUmljaG1laWVy?= | last post by:
Is there a way to catch an application configuration error on startup? I have written a windows service. If there is an error in the configuration file (such as invalid xml) the exception is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.