Jump to content

shalmoli

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by shalmoli

  1. We have got 2 Debian servers - a testing and a production server. I could successfully install the SSH module for PHP in the test server. However,in Production Server, I would like to copy the compiled packages and make the changes in php.ini to add the ssh module. I have Copied libssh2.so file and the ssh.so file from test to production server. Added the extension directive in php.ini Doing this I can connect with SSH to the remote server but fopen into the remote server fails. It fails in the following code :(in the production server) @fopen('ssh2.sftp://'.$sftp.$remoteFile, 'w'); $sftp is the SFTP connection $remoteFile is the full path of the remote file that needs to be created. This code works perfectly in the test server. What did I do wrong. Any help is welcome including some explanation on how the libssh2 package is compiled in Debian.(I am quite new to Debian and in the process of understanding how the system works).
  2. I would like to have Jasper Reports work with PHP. The first step in this direction seems to be installing the PHP - Java Bridge. I have gone through a lot of documents in the internet and most of them refer to a dll - php_java.dll for installing in Windows. However, currently I could not find this dll in the .war file when I downloaded from sourceforge. Is there is way out to integrate Jasper Reports with PHP?
  3. Well, I managed to solve the issue and I thought I would post the solution in case somebody else tries a similar setup. Php script was connected to database that was throwing an exception which strangely was not reported while browsing directly. When the exception in php was handled and the output was started before the function call was made, the issue was resolved.
  4. I need to set up a Java client - PHP server framework. When the Java client sends a request it is correctly processed by the php page. However, the response string is not read by Java. There are no proxy issues as I have a direct route. However, when I call the php page through a browser , it is correctly displayed. What may be going wrong? Is it something to do with Apache?
  5. Thanks a lot :-) The issue was indeed the trailing slash in upload_tmp_dir. The issue is resolved now.
  6. Thanks for the reply. I am copying the value of both the directives from phpinfo() open_basedir /var/www/tor/projects/:/tmp/:/var/tmp/:/var/www/tor/tmp/:/var/lib/php5:/usr/share/php/ no value upload_tmp_dir /var/www/tor/tmp/ no value Do you think there are any other field in php.ini that influences the value?
  7. In php.ini - - tmp_dir is set - open_basedir includes tmp_dir path Still I get file upload error 6. I guess there is some issue in the php.ini config. I guess there are just 2 directives that interfere with file uploads - tmp_dir and open_base_dir. Max size is 2M , so I guess there are no issues regarding file size as I am just trying to upload a testfile of 1KB. I get the error right at $_FILES. Array ( [userfile] => Array ( [name] => test.txt [type] => [tmp_name] => [error] => 6 => 0 ) ) I am posting the code and this code works in one server but not the other. _________________________________________________________________________ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Upload Test</title> </head> <body> <form enctype="multipart/form-data" action="upldtest.php" method="POST"> <!-- MAX_FILE_SIZE must precede the file input field --> <input type="hidden" name="MAX_FILE_SIZE" value="99999999" /> <!-- Name of input element determines name in $_FILES array --> Send this file: <input name="userfile" type="file" /> <input type="submit" value="Send File" /> </form> </body> </html> <?php $form_data = $_FILES['userfile']['tmp_name']; print_r($_FILES); //set the location $base_name = $_SERVER['DOCUMENT_ROOT']."/uploads/".$form_data; //move_uploaded_file($form_data, $base_name); // upload the file to the server if(copy($_FILES['userfile']['tmp_name'], $base_name)){ echo "upload successful"; } else{ echo "Upload Failed"; } ?> Any suggestions?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.