php virtual()

Hello,
I have error:

# php test.php

Fatal error: Call to undefined function  virtual() in /path/to/test2.php

help me please:)
coolvdsAsked:
Who is Participating?
 
coolvdsAuthor Commented:
Solved.
Problem solved after suexec installation.
0
 
Kiran SonawaneProject LeadCommented:
virtual() is actually a PHP function, but you have to be using apache and have apache functions enabled.

My guess is, what you want is the include() function.

Change from

<?php virtual("test2.php"); ?>

Open in new window


to

<?php require_once("test2.php"); ?>

Open in new window

0
 
coolvdsAuthor Commented:
I need virtual() only.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
Ray PaseurCommented:
Like all PHP functions, virtual() is documented in the online man pages.  Please read this over and then post back with any specific questions.
http://php.net/manual/en/function.virtual.php
0
 
coolvdsAuthor Commented:
I use   virtual($file);
it's not work
What I muse enable in server configuration?

0
 
Scott MadeiraCommented:
I'd start here from the php man pages:  

"This function is only supported when PHP is installed as an Apache module."

Do you know how your php setup was installed and configured?
0
 
coolvdsAuthor Commented:
Yes


# apache2ctl -V
Server version: Apache/2.2.14 (Ubuntu)
Server built:   Nov 18 2010 21:19:09
Server's Module Magic Number: 20051115:23
Server loaded:  APR 1.3.8, APR-Util 1.3.9
Compiled using: APR 1.3.8, APR-Util 1.3.9
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT=""
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"
0
 
Scott MadeiraCommented:
What about PHP?  What does phpinfo(); show you?
0
 
coolvdsAuthor Commented:
What part I shold show ?
0
 
Scott MadeiraCommented:
Server API - top section fourth item down and right below the configure command.  If it says CGI then virtual() is not available to you.  If it says something about Apache module then virtual() should be available and you have a different problem.

Why do you have to use the virtual() function?  include() or require() would probably be a better choice.
0
 
coolvdsAuthor Commented:
becouse other comment can't help me
Solution were easy
0
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.