Questions tagged [require-once]

The PHP require_once function

The PHP require_once function.

In contrast to require this function only includes the referred file if it has not been included before.

Use this tag only for questions that directly ask about require_once usage. Do not use this tag if your code contains require_once but you have no reason to believe that require_once is directly related to the issue you are asking about.

409 questions
0
votes
1 answer

PHP - Eclipse PDT require_once on linked folder

I have 2 php projets in Eclipse PDT (1 for classes, 1 client using classes). I don't want to manually sync folders. I created linked folders, which seems solving the pb (classes appears in the client project), but when i require it, i get the 'no…
0
votes
2 answers

Generating an array of functions?

I have a few PHP files filled with multiple functions. Let's call them functions1.php, functions2.php, functions3.php: function function_something( $atts ) { extract( something_atts( array( 'foo' => 'bar', 'bar' => 'foo, …
Wordpressor
  • 7,173
  • 23
  • 69
  • 108
0
votes
1 answer

Default Content on failed require_once

Just started learning PHP today. And though I moved through most of my problems quickly, I got stumped with this one. I have a main page page.php with a dynamic require_once to pull up content. I got the main part working, which is page.php?id=1…
0
votes
1 answer

Wrong path with Zend_AutoLoader (only online)

I made a test appli with Zend and tried to put it online (on an ovh shared server) Running offline (with WampServer), but not online. Here is the error that I can't solve : Warning: require_once(/library/Zend/loader/Autoloader.php)…
zessx
  • 68,042
  • 28
  • 135
  • 158
0
votes
2 answers

require_once() issues

I'm having some require_once() issues. Code:
Paul Dessert
  • 6,363
  • 8
  • 47
  • 74
0
votes
1 answer

Undefined class variable in PHP

I have made a separate class to connect to my database and that class is in a separate PHP file: connect.php class connect{ function __construct(){ // Connect to database } function query($q){ // Executing query …
Keshav Nair
  • 423
  • 1
  • 14
  • 24
0
votes
2 answers

Fatal error: require_once() [function.require]

When i try to call require_once function that gave to me following error message I'm sure "/www/mvc/controllers/router.php" is correct path for my router.php file
user881703
  • 1,111
  • 3
  • 19
  • 38
0
votes
1 answer

cannot require_once in a jquery post call

I am struggeling with a Jquery post call that returns SyntaxError unexpected token if I try to require_once the needed files to instantiate the php object and get the propertie of that object. What is weird is that it seems to be working on my…
Pegasuz73
  • 23
  • 4
0
votes
1 answer

jqueryUI functions fail to be found when php require_once is used for common script components in page

When attempting to include the jquery library via a php require_once() I find that invocations of the .dialog() component of JQuery UI produce an error message: $("#dialog").dialog is not a function This seemed strange to me as upon inspecting the…
xenador
  • 211
  • 4
  • 15
0
votes
1 answer

require_once("facebook-sdk/facebook.php") throws a warning "failed to open stream:Permission denied"

I'm trying out the tutorials for Facebook developers. However, I can't include the Facebook PHP SDK successfully in my code. As stated, require_once("facebook_sdk/facebook.php"); throws the following error: Warning:…
skytreader
  • 11,467
  • 7
  • 43
  • 61
0
votes
1 answer

PHP installation warning: [function.require-once]: failed to open stream

Im having problems trying to install locally a script of a groupon clone. Im using XAMPP running in windows7 Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 MySQL client version: mysqlnd 5.0.7-dev - 091210…
dan
  • 990
  • 1
  • 14
  • 22
0
votes
1 answer

Call to member function on a non-object

I've read several of the threads that already exist with this, or a similar, name. None seems to address my situation exactly. I'm getting this error from my utils.php class. Notice: Undefined variable: debug in /app/www/utils.php on line 89 Fatal…
elemjay19
  • 1,126
  • 3
  • 25
  • 51
0
votes
1 answer

require_once issues, when calling functions included in another file

here is my problem: index.php contents: require_once('phpcommonscripts/connections/connection.php'); require_once('phpcommonscripts/functions/logging.php'); Func_LogToDB($logType, $actionType, $errMsg, $varUser); connection.php…
MirrorMirror
  • 186
  • 8
  • 36
  • 70
0
votes
2 answers

require once issue in php

I am using xampp to develop my php application. Few days back I installed pear ti use DB abstraction. After that, I couldn't use include files from parent directory, however I can include from sub-driectories. Here is what I see when I check my…
aarpey
  • 158
  • 1
  • 3
  • 15
0
votes
0 answers

PHP require_once behaving asynchronously instead of syncronously

There is a good chance that this has been asked before, but I can't find an answer that works in my situation. I'm a hobby programmer, not a professional developer:-) I have a client side script running under WordPress (which I don't think is…
SteveParry
  • 117
  • 1
  • 1
  • 10