Jump to content

php classes


ltbaggz

Recommended Posts

quick question, is there anything special that needs to be set in order for classes to be enabled in php?  i know this is a stupid question but whenever i try to implement the simplest class in one of my scripts it returns a blank screen.  a special place to include the file maybe?  I am running PHP Version 4.3.9 which is what was with my linux distribution.  i guess i should try to upgrade this.  let me know if you guys have any other ideas.  if the update is the problem, is there a simple way to update the current php installation? i am running redhat enterprise edition.

thanks
drew
Link to comment
https://forums.phpfreaks.com/topic/28689-php-classes/
Share on other sites

No, there is nothing special that needs to be enabled. Also, php4 is perfectly capable of using classes, just a little different to php5.

Does this produce any output?
[code]
<?php
  class foo {
    function bar() {
      echo "this is bar";
    }
  }
  $f = new foo();
  $f->bar();
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/28689-php-classes/#findComment-131291
Share on other sites

Im not sure what package management system redhat uses, havent used it in a long time (Im a Gentoo Linux user), but php is easily enough compiled from source.

There are some pretty usefull install instructions in the [url=http://php.net/install]manual[/url], otherwise I might suggest posting your question in a redhat forum.
Link to comment
https://forums.phpfreaks.com/topic/28689-php-classes/#findComment-131320
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.