php path error in imagejpeg() [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
when i use imagejpeg() it works fine in local while giving error on live
here is the warning message
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'http://test.ourserv.com/Optfolder/cmp_dd5ac79bcf/20131027_185925.jpg' for writing: No such file or directory in /home3/test/public_html/server/Optfolder/image_re.php on line 36
i had same error with opendir() but when i write path like this it resolved but when i use even this kind of path instead of http it does not work with imagejpeg()
what is the path should i use,why path work locally fine and not on live server in php??
opendir('/home3/test/public_html/server/Optfolder/upload/upload');

use path like this
this will help you
$abs_dir=dirname(__FILE__);

Related

Directory of the page a file is included in [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am including a page in the directory all with the function basename(__DIR__) which is in the directory inc, so echo basename(__DIR__); returns the directory inc, instead of directory all.
How can I fix this?
Maybe, the best way is define some specific constant in file that placed in all folder and then included into other?
define('ALL_PATH', realpath(dirname(__FILE__)));

Alternative to PHP Include? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am trying to include an external page onto my main home page of my website. However, when I use include_once or just php include alone, it throws this error at me:
Warning: require_once(../_inc/glob.php) [function.require-once]: failed to open stream: No such file or directory in /home/radisite/public_html/panel/_frontend/requests.php on line 2
I don't want to use iFrame because then it slows my site down completely. Is there any other faster alternative for PHP includes? I've looked at other methods on here and they're confusing me to bits.
Thank you!
It seems that you have a problem with the path of the file. Check your file path and it will work.
You may either specified a wrong path, or have problem with include_path setting; If you are sure your path is formed correctly, then either adjust include_path, or prefix your path with dirname(__FILE__) on PHP < 5.3 or __DIR__ on PHP >= 5.3
use
require_once($_SERVER["DOCUMENT_ROOT"]."/yourfolder/".'glob.php')

Error on including a file - Warning: include(connect.php): failed to open stream: No such file or director [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
Here is the image of project file structure -
I added include 'connect.php' in index.php file.
Index.php file is present in register folder. But i get an error 'failed to open stream no such file'.
You could add a simple DOCUMENT_ROOT to your include in which way it will always go for the direct server path to the file.
include $_SERVER["DOCUMENT_ROOT"]."/connect.php";

How to uploading of file with out browse in php [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to upload some files without browse button, i just wanna have a fixed path and upload button, can anyone help me out, i think this is possible in asp.net
There is no way for a website to specify which file the user's browser should upload. This would be a dangerous security risk as the user might not notice the file selection.

File_get_contents function does not work with windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
file_get_contents("https://api.groupon.com/v2/deals.xml?division_id=cleveland&client_id=39ddf70c45844d5a9d5a92e5106f1b229b2e1df8");
This code does not work on windows, but does with Linux. Because of https. Is there any solution.
It's possible you did not enable your url file open in your PHP configuration.
See http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen for details on this configuration value.
If this is not the cause, then you should specify what the exact error is, do this by adding the following to your code, before the file_get_contents function:
error_reporting(E_ALL);
ini_set('display_errors', 'On');

Categories