File Upload not working in PHP

Hello

We have a web application written in PHP5. The same code works on XaMPP/Enterprise linux and XAMPP/Windows. However the code doesn’t work on Suse Linux. I have tried everything possible. It looks like something at system level stopping the file upload process.

Does it have anything to do with SELINUX?? The xampp server on enterrprie linux has a little box on the bottom that say SELinux = T-file. but I don’t see that box on suse linux.

Any clue ?? Need some help real bad.

Thanks
Websoul

Welcome here.

I am afraid that you did not provide much information. Not even which version of openSUSE you are running. And as you say somewhere “Suse Linux”, it could even be that you do not have openSUSE at all, but SLES (or SLED). In which case you are at the wrong forum. The SLED/SLES forum is at: SUSE Forums

Henk,

Sorry about that! We are running suse 11.2. All other functionality of the website is working correctly except this file upload which is critical to the business. I will appreciate greatly if I can fix this issue by tomorrow.

= I have already checked php.ini, already made the directory writable , checked Apache setting to make sure directory entries are correct. My programmer have given up and I think it is something in the OS that we need to fix/setup…

That does not bring us much further. Is this openSUSE 11.2 (which is not supported anymore btw) or SUSE 11 service pack 2.
Please be precise in what you say. It seems that you are in a critical situation, thus do not loose much time in providing vague statements.

Henk,

It is 11 service pack 2.

Well, that is SLED/SLES. I say again, you are at the wrong forums. The link to the correct one is in my first post above.

People here might be able to help you, but the majority never used SLED/SLES. I did never.

That said, your problem might point to access denied somewhere. When you decide to ask further here and not at the SLES/SLED forums (you could go for both of course), you should provide real technical information. Most what you said is just some explanation that should go with the technical facts that are missng.

E.g. when you say “already made the directory writable”, you should tell which directory and at best post what it’s ownership and access bits are now by posting the command and the output:

ls -ld <path-to-and-name-of-that-directory>

And why we are at it, as access is for user/group/world, it is important to know which user/group runs the PHP scripts and that is the same user/group that runs the Apache server. And the output of

ps -ef | grep apache

will tell us.

And so on. Just saying that you checked something without showing us what you saw is useless. You have a problem, thus you most prrobably did NOT see something that others might see. But only when there is something to look at.

BTW do not forget to use CODE tags about that copied/pasted output. See: http://forums.opensuse.org/english/information-new-users/advanced-how-faq-read-only/451526-posting-code-tags-guide.html

Hi,

In modern PHP environments, you cannot just change the folder permissions to 777 and files to 666. Perms working elsewhere should work on openSUSE. But … who is the owner of the webcontent? On openSUSE the owner-group should be wwwrun-www. Please check. Also, check whether the appropriate php modules have been installed, apache restarted after addition of php modules.

The owner is wwwrun. I have installed all module related to PHP. Apache have been restarted many times. The worst part is I do not have any error for this stupid thing not working. The only difference between my old Oracle Linux (xampp) and Suse (lampp) is that the former has SELINUX installed where Suse I don’t have SELINUX installed. In the XAMPP set up, I see a SELINUX= ‘t-file’ on the window granting write authority to the folder.

Maybe I am giving you and info you already know but did you use in your code something like this to see the errors?



<?php
    error_reporting(E_ALL);
    ini_set("display_errors", 1); 
?>

If the file is big, could be an issue of php.ini settings related to file size, memory limit, execution time.

Are the paths for uploads correctly passed?

Cheers.

Yes I did!! The problem is it doesn’t throw any error in log or in the screen.

I took the advice from the gentleman above and compared the modules between the working Linux (oracle ) and non working (SUSE) and found that the SUSE linux has missing many modules. Now the question is how do i install these module.?

====

Here is the list of all the modules. (XX) it is installed in Iinux.

modules in Modules present in
Oracle linux Susue Linux 11.2
(XAMPP) (suse Lampp)
=============== =================
not present mod_autoindex

core xx
prefork xx
http_core xx
mod_so xx
mod_authn_file xx
mod_authn_dbm
mod_authn_anon
mod_authn_dbd
mod_authn_default
mod_authz_host xx
mod_authz_groupfile xx
mod_authz_user xx
mod_authz_dbm
mod_authz_owner
mod_authnz_ldap
mod_authz_default xx
mod_auth_basic xx
mod_auth_digest
mod_file_cache
mod_cache
mod_disk_cache
mod_mem_cache
mod_bucketeer
mod_dumpio
mod_echo
mod_case_filter
mod_case_filter_in
mod_ext_filter
mod_include xx
mod_filter
mod_charset_lite
mod_deflate util_ldap
mod_log_config xx
mod_logio
mod_env
mod_mime_magic
mod_cern_meta
mod_expires
mod_headers
mod_ident
mod_usertrack
mod_unique_id
mod_setenvif xx
mod_proxy
mod_proxy_connect
mod_proxy_ftp
mod_proxy_http
mod_proxy_ajp
mod_proxy_balancer
mod_mime xx
mod_dav
mod_status xx
mod_autoindex
mod_asis xx
mod_info
mod_suexec
mod_cgi xx
mod_cgid
mod_dav_fs
mod_vhost_alias
mod_negotiation xx
mod_dir xx
mod_imagemap xx
mod_actions xx
mod_speling
mod_userdir xx
mod_alias xx
mod_rewrite xx
mod_apreq2
mod_ssl xx
mod_php5 xx
mod_perl

===================

Ghost, I have checked all that. I have the error messages turned on… INI File checked.

Installing or enabling them?

In any case, both can be done from YaST

The first from software manager, the other from Network Services / Webserver

You need to have those installed first before enabling them.

And I think that you should also check the php extensions that you have on the two systems.

Cheers.

Visit the this page, and look at HTML source how they remove this problem.

On 06/13/2013 04:16 PM, ProgKvi wrote:
> Visit the this ‘page’, and look at HTML source how
> they remove this problem.

sorry, but i don’t see how the html source of that page solves the
PHP question asked last year…

please copy/paste the relevant source into this thread, inside code
tags…

tia!


dd