close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

php undefined function error

Thread began 4/16/2011 6:27 pm by rob.parkin390637 | Last modified 5/26/2011 9:29 am by Jason Byrnes | 5984 views | 13 replies |

rob.parkin390637

php undefined function error

Hi, just created a php site using siteassitpro, but when I test pages on my remote server they are not displaying as they should. Problem seems to be with the line which references the menu php code for the page: <?php virtual("/CSSMenuWriter/cssmw_home/menu.php"); ?>

On the server in place of a navigation menu in the page I get the error message:

Fatal error: Call to undefined function virtual() in E:\domains\b\buytilesbypost.co.uk\user\htdocs\index.php on line 66

I know a little VB / ASP but I'm new to php - what am I missing?

Sign in to reply to this post

neilo

Try changing:

<?php virtual("/CSSMenuWriter/cssmw_home/menu.php"); ?>


to:

<?php require_once("/CSSMenuWriter/cssmw_home/menu.php"); ?>
Sign in to reply to this post

rob.parkin390637

php error ...

Hi - thanks for posting, tried that but got error messages:

Warning: require_once(/CSSMenuWriter/cssmw_home/menu.php) [function.require-once]: failed to open stream: No such file or directory in E:\domains\b\buytilesbypost.co.uk\user\htdocs\index.php on line 66

Fatal error: require_once() [function.require]: Failed opening required '/CSSMenuWriter/cssmw_home/menu.php' (include_path='.;C:\php5\pear') in E:\domains\b\buytilesbypost.co.uk\user\htdocs\index.php on line 6

Sign in to reply to this post

neilo

This error message is saying tha the menu.php file cannot be found in its expected location (CSSMenuWriter/cssmw_home/menu.php). Check that the file is there to be found. I see you are rebuilding your site from .asp to php - if you are setting off converting the original php files, make sure that you haven't got a menu.asp file instead of the menu.php version (your remote site has CSSMenuWriter/cssmw_home/menu.asp).

Sign in to reply to this post

rob.parkin390637

Hi again Neilo

Using the same connection script etc (in Dreamweaver) to the remote server, I built the same site first in html, then in php and then in asp - backing up and moving the previous versions each time. You were looking at the contents of the asp version, which came after the problematic php version!

I agree that the message is saying it can not find the file in question (menu.php) which contains the php code to be "included" in index.php which is the "calling" file. The asp version "finds" menu.asp without any problem but the php version seems to get lost ...

My guess is it has something to do with the way the path is interpreted or concatenated or something in the php version, but as I'm not sure how this is done I don't know what to do to fix it.

Sign in to reply to this post

Jason ByrnesWebAssist

the require once line should not include the leading forward slash:
<?php require_once("CSSMenuWriter/cssmw_home/menu.php"); ?>

in your site definition, there is a settings on the local info tab for "Create Links relative To", change this setting to "Document" instead of using "Site" so that Dreamweaver will create the include paths using the require_once() function instead of the virtual() function.

Sign in to reply to this post

rob.parkin390637

Thanks Jason, that worked for the "top level" pages - but those in sub-directories on the site just generate a simailar error message as before:


Warning: require_once(CSSMenuWriter/cssmw_content/menu.php) [function.require-once]: failed to open stream: No such file or directory in E:\domains\b\buytilesbypost.co.uk\user\htdocs\tiles\bathrooms\ceramic2.php on line 98

Fatal error: require_once() [function.require]: Failed opening required 'CSSMenuWriter/cssmw_content/menu.php' (include_path='.;C:\php5\pear') in E:\domains\b\buytilesbypost.co.uk\user\htdocs\tiles\bathrooms\ceramic2.php on line 98


... so any pages on th3e same level as "tiles" are found ok, but anything lower isn't. All the pages other than index.php are generated via a Dreamweaver template.

Sign in to reply to this post

Jason ByrnesWebAssist

the path to the CSSMenuWriter/cssmw_content/menu.php file is relative to the document location.

the menu file will be at the root of the site so for a documet in a sub directory, you will need to modify the path.

for:
\tiles\bathrooms\ceramic2.php the path needs to go down 2 directories to the site root, then look for the CSSMenuWriter/cssmw_content/menu.php file:


<?php require_once("../../CSSMenuWriter/cssmw_content/menu.php"); ?>


like i said before, if you change the Create Links relative to option to document, then recreate the site using Site Assist, the pages will be created with the correct paths.

Sign in to reply to this post

rob.parkin390637

It's grand when something works ... I had forgotten to recreate the site using SiteAssist Pro!

Thanks for your help.

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...