LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-27-2003, 04:05 AM   #1
Xing
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RH 9, RH 8, RH 7.3,Slackware
Posts: 123

Rep: Reputation: 15
PHP problem


i have PHP on my RH9 system...
when i run an upload script... and press button upload, it automatically diverts the page to google.co with search string of google.. why does this happen and how can this be stopped??

please help

Regards
Xing
 
Old 10-27-2003, 02:06 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
It sounds like your script probbaly has google set as the action in the form.
 
Old 10-27-2003, 02:42 PM   #3
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
or it does some url forwarding and has a non existant url in there and your browser jumps to google as it's search page...
 
Old 10-27-2003, 11:28 PM   #4
Xing
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RH 9, RH 8, RH 7.3,Slackware
Posts: 123

Original Poster
Rep: Reputation: 15
thanks for replying but i do not think that is the problem.. i m posting my form tag and i assure u i am not using header anywhere

<form action='upl.php' method=post enctype='multipart/form-data'>

some other suggestions?? maybe to do with global variables??

Regards
Xing
 
Old 10-27-2003, 11:53 PM   #5
Xing
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RH 9, RH 8, RH 7.3,Slackware
Posts: 123

Original Poster
Rep: Reputation: 15
This is my upload script... the post and get variables are passing fine but then when i try to upload using this script.. it goes to google... with a search string of localhost..
Max Upload is set to 80MB in php.ini and i am trying to upload just 1 MB file.. also uploads have bee set on..
please suggest

Regards
Xing


$action = $HTTP_POST_VARS["action"];
$max_size = "50000000"; // Max size in BYTES (1MB)
$updir = "/var/www/html";

echo "
$updir<br>$action<br>
<b>Uploader</b><br>
<form action='upl.php' method=post enctype='multipart/form-data'>
File (max size: $max_size bytes/".($max_size/1024)." kb):<br>
<!-- This is NOT a secure method of checking filesize, but it tells the user if he tried to upload a file too big before
he waits for the huge file to upload, make sure to check the filesize after the form is sent as well -->
<!-- <input type='hidden' name='MAX_FILE_SIZE' value='$max_size'> (removed because it wasn't working properly) -->
<input type='file' name='filename'><br>
<input type='hidden' name='action' value='upload'>
<input type='submit' value='Upload File'>
</form>";


if ($action == 'upload')
{
print "teri jai ho";
exit;

if ($_FILES["filename"]["size"] > $max_size) die ("<b>File too big! Try again...</b>");


copy($_FILES["filename"]["tmp_name"],$updir.$_FILES["filename"]["name"]) or die("<b>Unknown error!</b>");
//copy($_FILES["filename"]["tmp_name"],"./".$_FILES["filename"]["name"]) or die("<b>Unknown error!</b>");
echo "<b>File Uploaded.</b>"; // for debug --> $filename --> ".$destination."/".$filename_name."</h2>";
}
 
Old 10-28-2003, 01:03 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
Have you tried it in other browsers?
 
Old 10-28-2003, 01:12 PM   #7
Mirrorball
Member
 
Registered: May 2003
Location: Brazil
Distribution: Gentoo
Posts: 81

Rep: Reputation: 15
Have you tried to upload a small file? Check your php.ini file, see if you are allowed to upload files, and what the max size is. Take a look at /etc/apache2/conf/modules.d/70_mod_php.conf too.
 
Old 10-29-2003, 04:49 AM   #8
Xing
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RH 9, RH 8, RH 7.3,Slackware
Posts: 123

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by david_ross
Have you tried it in other browsers?
i tried konqueror on you advice .. as you can noice from my script it has a max size of 50000000 bytes.. that makes it about 40000 KB.. now when i tried to upload a 40 KB file, it tried to do so but actually could not do it giving this error


Unable to create '/var/www/htmlinstall.log': Permission denied in /var/www/html/upl.php on line 46

line 46 is the line where copy is taking place .. i will look into it and post the results...

when i tried to upload a 1.1 MB file, it gave me this error...

An error occured while loading http://localhost/upl.php:


Connection to host localhost is broken


why did this happen?? as max_file_size in upload file is much more than 10MB and upload limit and max post size in php.ini is around 80 MB why did this happen??

This problem has to be solved because i have been requested by at least 10 people to forward the solution to them.. so this problem has quite a wide base.

Regards
Xing
 
Old 10-29-2003, 06:22 AM   #9
Xing
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RH 9, RH 8, RH 7.3,Slackware
Posts: 123

Original Poster
Rep: Reputation: 15
This PHP problem needs to be solved

OK People.. This is the recent bit of research i have done and this is to be taken care of..
In php.conf, which is a httpd file, we have to take care of this value

LimitRequestBody

Set this to a higher value.. this governs the upload limit of your script as well... but my script is still giving me troubles... so lets see further.. till then

Regards
Xing
 
Old 10-29-2003, 12:40 PM   #10
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
There is also a max upload size in php.ini
 
Old 10-29-2003, 10:02 PM   #11
Xing
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RH 9, RH 8, RH 7.3,Slackware
Posts: 123

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by david_ross
There is also a max upload size in php.ini
i have written in a previous post that max upload size is set to 80MB. Also max post size is set to 80MB.. i think we should concentrate on the issue of why permission is being denied inspite of full permission to executing script and the file that is to be uploaded?

Regards
Xing
 
Old 10-30-2003, 01:51 AM   #12
Mirrorball
Member
 
Registered: May 2003
Location: Brazil
Distribution: Gentoo
Posts: 81

Rep: Reputation: 15
And there is another in /etc/apache2/conf/modules.d/70_mod_php.conf
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM
New to PHP and Postgressql. Is this a PHP problem or a sql problem. Please help sendas4 Linux - General 2 11-05-2004 01:54 PM
Problem getting PHP to recognize MySQL, Using PHP 4.0 and MySQL 4.0.20 d2army Programming 4 06-27-2004 08:54 PM
RH9: PHP session problem (or Apache problem) fengcn Red Hat 0 12-01-2003 06:32 PM
Apache php index.php problem neurotic Linux - Software 3 11-18-2003 06:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration