Error while invoking REST service - php

I am facing a strange problem. I am trying to integrate a REST api in phonegap application.
When I request the url say http://myserver/index.php?m=login via a rest client in my browser it works fine.
But when I invoke it via jQuery ajax it returns the following error:
Warning:
include(C:/Domains/my-portal.org/httpdocs/mmode/template/mobile/index.php)
[function.include]: failed to open stream: No such file or directory
in C:\Domains\my-portal.org\httpdocs\mmode\index.php on line 13
Warning: include(C:/Domains/my-portal.org/httpdocs/mmode/template/mobile/index.php)
[function.include]: failed to open stream: No such file or directory
in C:\Domains\my-portal.org\httpdocs\mmode\index.php on line 13
Warning: include() [function.include]: Failed opening 'C:/Domains/myportal.org/httpdocs/mmode/template/mobile/index.php' for inclusion (include_path='.;./includes;./pear;C:\PHP\includes') in C:\Domains\my-portal.org\httpdocs\mmode\index.php on line 13
Now the problem is not cross-domain scripting because the response header returns "Access-Control-Allow-Origin: *". And I have also white-listed the domain in cordova settings.
Can anyone please guide me what could be the problem here?

Related

How do you use file_get_contents() on PhpStorm?

Usually, you could just enter the URL from a website to get the HTML code. However, on PhpStorm, when I try to do:
file_get_contents("http://localhost:63342/Prj1_Submission1/index.php?_ijt=i77g98br35guk27egnuaaj3va6")
where the URL is generated by PhpStorm for my index.php it gives me this error:
Warning: file_get_contents(http://localhost:63342/Prj1_Submission1/index.php?_ijt=i77g98br35guk27egnuaaj3va6): failed to open stream: HTTP request failed! in C:\Users\prajw\PhpstormProjects\Prj1_Submission1\search.php on line 18

moved website: failed to open stream no such file or directory

I have seen different variations of this problem which I have tried to use without any success so i figured it would be best just to ask.
I recently moved my website from my wamp server over to my qnap server. Seams to be working quite well except 3 errors that popped up (did not have them on my local host and havent changed any of the code).
I get the following 3 errors.
Warning: include(/share/HDA_DATA/Web/application/views/errors/html/error_php.php): failed to open stream: No such file or directory in /share/HDA_DATA/Web/system/core/Exceptions.php on line 269
Warning: include(): Failed opening '/share/HDA_DATA/Web/application/views/errors/html/error_php.php' for inclusion (include_path='.:/etc/config/php') in /share/HDA_DATA/Web/system/core/Exceptions.php on line 269
Warning: include(/share/HDA_DATA/Web/application/views/errors/html/error_php.php): failed to open stream: No such file or directory in /share/HDA_DATA/Web/system/core/Exceptions.php on line 269
Warning: include(): Failed opening '/share/HDA_DATA/Web/application/views/errors/html/error_php.php' for inclusion (include_path='.:/etc/config/php') in /share/HDA_DATA/Web/system/core/Exceptions.php on line 269
I seam to understand what is going on that it cannot access the file but can anyone point out what i need to change and where/which file i need to change it. I have not done any changes to my codeigniter file structure (all original setup). If you need code dump just let me know from which file.
Thank you for your help.
Jonas

PHP Error - Can't Open Files

I am building a small PHP system, and I can't open files like CSS Styles, PHP Include function and Images.
I also got some errors:
Warning: include(includes/functions.php) [function.include]: failed to open stream: No such file or directory in /home/chezki/public_html/XXX.XXX/cp/CMS/index.php on line 2
Warning: include(includes/functions.php) [function.include]: failed to open stream: No such file or directory in /home/chezki/public_html/XXX.XXX/cp/CMS/index.php on line 2
Warning: include() [function.include]: Failed opening 'includes/functions.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/chezki/public_html/XXX.XXX/cp/CMS/index.php on line 2
Built by YYY.YYY
logo // Thats the Logo alt
Fatal error: Call to undefined function getlists() in /home/chezki/public_html/XXX.XXX/cp/CMS/index.php on line 28
Title Actions // Some images alt
Edit: On Windows, It is Ok, but on Linux, It is doing those errors
More edit: Solved
From your error messages, your script appears to be this:
/home/chezki/public_html/XXX.XXX/cp/CMS/index.php
Your are trying to load this file:
includes/functions.php
Since you get this error message:
No such file or directory
... the obvious conclusion is that this file does not exist:
/home/chezki/public_html/XXX.XXX/cp/CMS/includes/functions.php
Feel free to edit your question and provide more details if this is not the case.
Edit: the file must have that precise name. If it's called e.g. Functions.php, it's a different file.
You have permission problems. Your web server cannot read functions.php due to wrong permissions. Adjust permissions with chown and chmod.

getting error while uploading on server

I am developing opencart application , i installed in on localhost ,and customize it but now i am trying to upload it to server but it get error
Warning: require_once() [function.require-once]: http:// wrapper is
disabled in the server configuration by allow_url_include=0 in
/home/content/29/9716229/html/johndhan/telhemboradz/index.php on line
17
Warning:
require_once(http://249development.us/johndhan/telhemboradz/system/startup.php)
[function.require-once]: failed to open stream: no suitable wrapper
could be found in
/home/content/29/9716229/html/johndhan/telhemboradz/index.php on line
17
Fatal error: require_once() [function.require]: Failed opening
required
'http://249development.us/johndhan/telhemboradz/system/startup.php'
(include_path='.:/usr/local/php5_3/lib/php') in
/home/content/29/9716229/html/johndhan/telhemboradz/index.php on line
17
You need to use paths for your files not HTTP url's. Open your config.php file and admin/config.php file and change
http://249development.us/
to
/home/content/29/9716229/html/
for all of the paths except for those that start HTTP_ or HTTPS_ in the define's
It seems that you are trying to include a remote file via HTTP. If this is intentionally the case, then you need to enable the http:// wrapper - as suggested by the warning you are getting. If this is not the case, then consider removing the URL http://249development.us/ from the require_once statements.

PHP Error when posting RSS feed data

I'm trying to post a blog to my website. I downloaded Simplepie and followed the directions on the website, but I keep getting these errors. Being new to PHP, I'm not exactly sure what they mean. Any help?
Warning: require_once() [function.require-once]: URL file-access is disabled in the server configuration in /hermes/bosweb/web177/b1775/ipg.waldropcom/php/test.php on line 7
Warning: require_once(http://www.waldrop.com/php/autoloader.php) [function.require-once]: failed to open stream: no suitable wrapper could be found in /hermes/bosweb/web177/b1775/ipg.waldropcom/php/test.php on line 7
Fatal error: require_once() [function.require]: Failed opening required 'http://www.waldrop.com/php/autoloader.php' (include_path='.:/usr/local/lib/php-5.2.17/lib/php') in /hermes/bosweb/web177/b1775/ipg.waldropcom/php/test.php on line 7
Probably your application trying to include a remote file but it's failing. You need to enable allow_url_fopen and allow_url_include settings in php.ini to require or include remote files.

Categories