require-once

How require_once in joomla2.5

邮差的信 提交于 2019-12-08 05:18:55
问题 I Have a problem about require_once in joomla. In this file php: components\com_test\views\__test_r5\tmpl\default.php I want to include some file using this code: require_once (JPATH_ROOT.DS.'/includes/General.php'); but require_once does not works 回答1: The path you are trying to include will evaluate to something like: joomla//includes/General.php . Notice the double slashes before "includes" . The constant DS is defined to be a directory separator. Try: require_once (JPATH_ROOT.'/includes

PHP error: open_basedir restriction in effect

▼魔方 西西 提交于 2019-12-08 04:05:26
I using this Yubico authentication PHP class: https://github.com/Yubico/php-yubico . I create php file test.php with this code: <?php require_once 'Auth/Yubico.php'; $otp = "ccbbddeertkrctjkkcglfndnlihhnvekchkcctif"; # Generate a new id+key from https://api.yubico.com/get-api-key/ $yubi = new Auth_Yubico('42', 'FOOBAR='); $auth = $yubi->verify($otp); if (PEAR::isError($auth)) { print "<p>Authentication failed: " . $auth->getMessage(); print "<p>Debug output from server: " . $yubi->getLastResponse(); } else { print "<p>You are authenticated!"; } ?> And do all instructions in this github library

PHP Doctrine Beginner: Doctrine\ORM\Tools\Setup not found

独自空忆成欢 提交于 2019-12-07 03:46:30
问题 im a beginner with doctrine. I just installed pear + doctrine 2.3.3 and want to test it. to test doctrine i wrote a class named "person" /** * @Entity */ class person { /** @Id @Column(type="integer") @GeneratedValue * */ private $id; /** @Column(type="string") * */ private $name; /** @Column(type="string") * */ private $surname; //some getters and setters ... } after that i made my bootstrap.php file, bootstrep_doctrine.php and cli-config.php files and run the command: doctrine orm:schema

require_once with subfolders [closed]

*爱你&永不变心* 提交于 2019-12-07 03:04:02
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I have Folder Home with two subfolders like the following +Home +include - membersite_config.php +iDiscover -index.php in index.php I added the require

Use Require_once() to include database connection variables correctly

本秂侑毒 提交于 2019-12-06 23:15:22
问题 I'm a php newbie (but long time developer in other languages) and I'm trying some example db connections in "PHP, MySQL, & JavaScript". It shows an example file to include db connection variables (servername, username, password, database, etc.). I have a php file which has a handful of functions I wrote and one of them has a few SQL queries. For whatever reason, calling require_once in that file doesn't output any errors (I have E_ALL config'd) yet those variables in my database php file are

php require_once tries to include a second time on my production server only

China☆狼群 提交于 2019-12-06 03:48:15
I have this code at the top of various include files: require_once("functions.php"); Sometimes I need to include several of my include files to generate a page and on my local server this works fine as the code above tells it to only include functions.php once (hence it doesn't attempt to declare functions twice). When I upload to my production server, suddenly it tries to include functions.php a second time, resulting in a fatal error from attempting to redeclare the functions a second time. Is there something in my php config on my production server that would be causing require_once to

PHP Check If require_once() Content Is Empty

喜夏-厌秋 提交于 2019-12-05 22:34:58
I am working on a PHP script which involves me including several external PHP scripts via the "require_once()" method. I would like to know if there is a way for the master script (the one including the others) to tell whether or not the processed output from included script has generated any content. So, for example, maybe the user's permissions for a particular script results in PHP not generating any output. So, maybe, the master script would echo something like: Nothing interesting here! Is there a way to do that in the master script, or would I need to create these tests inside of the

require_once ignored

送分小仙女□ 提交于 2019-12-05 05:42:45
问题 strange problem with php on windows... my application loads a 'core' file that loads a settings file, registers autoloads, does initialization etc. at the top of the core file I have include_once("config.php"); this works fine for anything in the current directory, if I include the core file from a separate directory though it just silently ignores the include of the config file... has anyone seen this before? /webroot/core.php <?php require_once "config.php"; //register autoloads //do some

How does include path resolution work in require_once?

两盒软妹~` 提交于 2019-12-04 09:03:01
问题 I was writing an web app in PHP, when I encountered a strange situation. To illustrate my problem, consider a web app of this structure: / index.php f1/ f1.php f2/ f2.php Contents of these files: index.php: <?php require_once("f1/f1.php"); ?> f1.php: <?php require_once("../f2/f2.php"); ?> f2.php: blank now when I try to open index.php in my browser I get this error: Warning: require_once(../f2/f2.php) [function.require-once]: failed to open stream: No such file or directory in /var/www

php include file that has includes

给你一囗甜甜゛ 提交于 2019-12-04 05:21:33
问题 I am working on a site and have been asked to include files that are sitting in a folder above my php scripts. Problem is those php files I have been asked to include, have includes in them. And thus the files they refer to cannot be found when calling my php pages. What is the best way to handle this situation? 回答1: When including a file from folder B to folder A, the B script acts like it was stored in A. Either change your pointer paths or chdir(). http://se2.php.net/manual/en/function