Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

php virtual()

Hello,
I have error:

# php test.php

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

help me please:)
0
coolvds
Asked:
coolvds
1 Solution
 
sonawanekiranCommented:
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
 
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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
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:
Solved.
Problem solved after suexec installation.
0
 
coolvdsAuthor Commented:
becouse other comment can't help me
Solution were easy
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now