2

Hi I have created multiple php pages and the pages are calling other pages using require_once or include function. When I run the main script, it is showing the following error:

Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/content/13/10377813/html/components/com_jumi/views/application/view.html.php(38) : eval()'d code on line 13

Warning: include( http://bphf2012.org/index.php?option=com_jumi&fileid=10 ) [function.include]: failed to open stream: no suitable wrapper could be found in /home/content/13/10377813/html/components/com_jumi/views/application/view.html.php(38) : eval()'d code on line 13

Warning: include() [function.include]: Failed opening 'http://bphf2012.org/index.php?option=com_jumi&fileid=10' for inclusion (include_path='.:/usr/local/php5_3/lib/php') in /home/content/13/10377813/html/components/com_jumi/views/application/view.html.php(38) : eval()'d code on line 13

Could anyone please help me how to sort out the issue...

Thanks.


Alright the error has been fixed after changing the server configuration but I am facing another problem now. When I am running the script, it is showing a blank page. I think I have made some mistakes on my scripts. Could you please check my php scripts which you can find from the following link:

https://www.dropbox.com/sh/vof0p4heo4csdn9/dj2NfgcWuE

What I did is, I have copied the scripts and pasted on the jumi component with the same name. After that I have assigned link on the menu manager to run.

If you want to see how it is displaying please visit my website:

http://bphf2012.org/index.php?option=com_jumi&view=application&fileid=3&Itemid=103

Please help me...

Thanks.

Kev
  • 118,037
  • 53
  • 300
  • 385
user1946440
  • 349
  • 1
  • 5
  • 13
  • You will probably want to turn on "display_errors" for php as well or check the php error log, because I'm guessing that php is still throwing an error around the require_once statement at line 16 of registration.php. That looks like where the document stopped rendering. – David Fritsch Feb 06 '13 at 07:08
  • I am sorry but how can I turn on display_errors... Actually I am a beginner php and joomla user... thanks. – user1946440 Feb 06 '13 at 07:18
  • for your situation, I would start by trying to change it at runtime. You can use a function at the top of your php function as outlined [here](http://php.net/manual/en/function.error-reporting.php) – David Fritsch Feb 06 '13 at 07:33
  • The errors are showing : Warning: require_once( http://bphf2012.org/index.php?option=com_jumi&fileid=10 ) [function.require-once]: failed to open stream: No such file or directory in /home/content/13/10377813/html/components/com_jumi/views/application/view.html.php(40) : eval()'d code on line 21 Fatal error: require_once() [function.require]: Failed opening required ' http://bphf2012.org/index.php?option=com_jumi&fileid=10 ' (include_path='.:/usr/local/php5_3/lib/php') in /home/content/13/10377813/html/components/com_jumi/views/application/view.html.php(40) : eval()'d code on line 21 – user1946440 Feb 06 '13 at 08:26
  • You are using a URL along with URL variables in your include statement (e.g. `bphf2012.org/index.php?option=com_jumi&fileid=10`). The correct way to include in php is to provide a system-based path to the file. For example, `require_once("/home/content/13/10377813/html/THE/REST/OF/THE/PATH_TO_YOUR_FILE")`. A better way to write this would be: `require_once($_SERVER["DOCUMENT_ROOT"]."/THE/REST/OF/THE/PATH_TO_YOUR_FILE")`. – Gor Feb 06 '13 at 11:59
  • I second @Gor's comment above, which is the same as my original answer. You are only going to have headaches trying to require a url. Instead you should use a file system path. Gor's comments are correct for PHP in general. Joomla gives you a few more constants to get to places within your Joomla install, and I recommend using those. – David Fritsch Feb 06 '13 at 12:04
  • I did try with both method but it is showing and error Warning: include(/home/content/13/10377813/html/components/com_jumicomponents/com_jumi/files/member.class.php) [function.include]: failed to open stream: No such file or directory in /home/content/13/10377813/html/components/com_jumi/files/registration.php on line 20.. but I have put the registration.php file in the exact location. – user1946440 Feb 06 '13 at 14:59
  • this error also displays with the above one: Warning: include() [function.include]: Failed opening '/home/content/13/10377813/html/components/com_jumicomponents/com_jumi/files/member.class.php' for inclusion (include_path='.:/usr/local/php5_3/lib/php') in /home/content/13/10377813/html/components/com_jumi/files/registration.php on line 20 – user1946440 Feb 06 '13 at 15:37
  • This file, `member.class.php` needs to be able to be found in that path you gave it, `/home/content/13/10377813/html/components/com_jumicomponents/com_jumi/fi‌​les/member.class.php`. Is it there? According to the error, it's not. – Gor Feb 06 '13 at 17:56
  • Error Problem Solved. the function supposed to be like include(JPATH_COMPONENT . '/files/member.class.php'); no error is showing. But it is actually a form with validation and once it is filled, the value will be stored to the database. If every thing is working fine then why it is not performing the same out put as expected. Could you please have a look on my files from the following https://www.dropbox.com/sh/vof0p4heo4csdn9/dj2NfgcWuE – user1946440 Feb 06 '13 at 19:44

3 Answers3

2

Since you responded that the url is your site, I would guess that the include and requires are for your own site, it would appear that you are pointing to the files in a non-standard way.

By routing through a url, you would require Joomla to set up for every file. Normally, you would just point to the exact file:

include(JPATH_COMPONENT . '/views/view_name/tpl/default.php');

You can look here for the different path constants that Joomla makes available.

David Fritsch
  • 3,711
  • 2
  • 16
  • 25
0

Looks like you're trying to include a remote file which is located out on http://bphf2012.org. This is inherently a security risk, therefore not possible.

Gor
  • 505
  • 1
  • 6
  • 18
  • Actually bphf2012.org is my joomla website and I have installed jumi component inside. So I want to use multiple pages using require_once, include or any proffered function which will help me to run other script into jumi. – user1946440 Feb 05 '13 at 18:10
  • According to the error message, `wrapper is disabled in the server configuration by allow_url_include=0`, you will need to turn on allow_url_include in your php.ini configuration file. Like this: `allow_url_include=1` – Gor Feb 05 '13 at 19:45
  • please see my new problem arise.. You can find it on the answers of this question... – user1946440 Feb 06 '13 at 06:53
0

Using a relative path sorted this for me.

flunder
  • 504
  • 6
  • 9