shell_exec and exec functions can not produce an output file [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
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
Improve this question
I have a server and client. Server has a php file. Here it is:
$postdata = $_FILES['request'];
$reqContent= file_get_contents($postdata['tmp_name']);
shell_exec("echo ".$reqContent." > request.txt");
I sent a file from client to server with this command :
curl -i -F "request=#example.txt" <server_url>
But output file(request.txt) can not created.How can i solve this problem?

Check your webserver error logs to verify that your not getting an error like 'permission denied' when you test that.
Also you might try shell_exec('pwd') and a shell_exec('whoami') and check the permissions on that directory to verify that the webserver user that is executing the command has permission to write there.

Related

php path error in imagejpeg() [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
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__);

Configurations for a php application [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
Well am creating a php based application therefore I wish to accompany it with a configuration file. However the configuration will have a few variables which will be updated once in a while.
Therefore how can I read a file and update a specific variable in it?
It's common to define your own configuration in .ini files and parse them with parse_ini_file()

ERROR 1030 (HY000): Got error -1 from storage engine [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
When I try to insert data into MySQL database I got this error:
Error Msg
#1030 - Got error -1 from storage engine
What could be the problem?
The first thing you do is check whether you are out of disk space.This error probably means you don't have enough memory for allocating to your table or database, or the specified memory settings for MySQL are too high for the configuration of your machine.
the following link may be useful to you http://wiki.jumpbox.com/doc/runtime/faq/mysql_maintenance

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";

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