PHP error require_once(Net/Server.php): failed to open stream:

Getting a PHP error when I run this php file on the line require_once ‘net/Server.php’;
php –f check_pear.php
//require_once 'System.php';
require_once 'Net/Server.php';
var_dump(class_exists('System', false));
PHP Warning:  require_once(Net/Server.php): failed to open stream: No such file or directory in /srv/www/htdocs/check_pear.php on line 3
PHP Fatal error:  require_once(): Failed opening required 'Net/Server.php' (include_path='.:/usr/share/php5:/usr/share/php5/PEAR') in /srv/www/htdocs/check_pear.php on line 3
I believe this is an issue with the path for pear/php or I am missing a package. I’m somewhat new to linux and still learning PHP so any help would by great.
When I run this file:
require_once 'System.php';
var_dump(class_exists('System', false));

I get:

My PHP info is:
PEAR path issue
Where PEAR installs .php files:
Configuration file is used by your PHP installation.
      Configuration File (php.ini) Path: /etc/php5/cli
Which php.ini is used by PHP on your web server?
Checked PHP's include_path setting on command line:
PHP Info
PHP Version 5.2.14

System       Linux domU-12-31-39-05-61-35 #1 SMP 2010-09-17 20:28:21 +0200 x86_64
Build Date       Mar 10 2011 17:26:30
Configure Command       '../configure' '--prefix=/usr' '--datadir=/usr/share/php5' '--mandir=/usr/share/man' '--bindir=/usr/bin' '--with-libdir=lib64' '--includedir=/usr/include' '--sysconfdir=/etc/php5/apache2' '--with-config-file-path=/etc/php5/apache2' '--with-config-file-scan-dir=/etc/php5/conf.d' '--enable-libxml' '--enable-session' '--with-mm' '--with-pcre-regex=/usr' '--enable-xml' '--enable-simplexml' '--enable-spl' '--enable-filter' '--disable-debug' '--enable-inline-optimization' '--disable-rpath' '--disable-static' '--enable-shared' '--program-suffix=5' '--with-pic' '--with-gnu-ld' '--with-system-tzdata=/usr/share/zoneinfo' '--with-apxs2=/usr/sbin/apxs2' '--disable-all' '--disable-cli'
Server API       Apache 2.0 Handler
Virtual Directory Support       disabled
Configuration File (php.ini) Path       /etc/php5/apache2
Loaded Configuration File       /etc/php5/apache2/php.ini
Scan this dir for additional .ini files       /etc/php5/conf.d
additional .ini files parsed       /etc/php5/conf.d/ctype.ini, /etc/php5/conf.d/dom.ini, /etc/php5/conf.d/hash.ini, /etc/php5/conf.d/iconv.ini, /etc/php5/conf.d/json.ini, /etc/php5/conf.d/pdo.ini, /etc/php5/conf.d/pdo_sqlite.ini, /etc/php5/conf.d/sqlite.ini, /etc/php5/conf.d/suhosin.ini, /etc/php5/conf.d/tokenizer.ini, /etc/php5/conf.d/xmlreader.ini, /etc/php5/conf.d/xmlwriter.ini, /etc/php5/conf.d/zlib.ini
PHP API       20041225
PHP Extension       20060613
Zend Extension       220060519
Debug Build       no
Thread Safety       disabled
Zend Memory Manager       enabled
IPv6 Support       enabled
Registered PHP Streams       php, file, data, http, ftp, compress.zlib
Registered Stream Socket Transports       tcp, udp, unix, udg
Registered Stream Filters       string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, convert.iconv.*, zlib.*

Who is Participating?
psimationConnect With a Mentor Commented:
Where on your server is that file: "net/Server.php" located in relation to your root?

Your root is /srv/www/htdocs/ - if the file is not inside of your document root or inside your PATH, then it will not find it.
pointhighAuthor Commented:
Thanks psimation,
Just ran find / -name Server.php
It did not find any thing for Server.php or server.php.
Looks like I still need a pear or php package.
 Where can I find that package and what is it?
What has been installed for pear is:
What Distro do you use? How did you install/build PHP (ie, did you just install PHP as part of the install options o the distro, or did you build it from source after the install of the OS?

On RedHat derivatives, i suggest you use yum or up2date to install and maintain packages.
As root, you can, for instance, install PHP with yum as follow:

yum install php*

This should install PHP and most packages and dependencies.
pointhighAuthor Commented:
The distro is Suse 11, loaded as an AIM instance on Amazon EC2.
I install both mySql and Apache2 by:
zypper in apache2-mod_php5 mysql
chkconfig apache2 on
chkconfig mysql on
service mysql start
service apache2 start
Most of PHP was install at the same time.
I also added pear from yast (I added all the pear packages in listed in yast) and added some php5 packages from yast.
My guess is that I missed the package, possibly a Pear package for Net_Server.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.