This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

PHP Can't Seem to Upload
#1
PHP Can't Seem to Upload
Hey Guys,

I have Sentora installed on an amazon EC2 instance (Centos 6.5). I am not entirely sure if this is directly Sentora related or not but for some strange reason I am unable to upload any files within PHP. For example uploading images inside Joomla CMS or Wordpress. Eevrything else works fine. I have tried everything I can think of to solve the problem.

At first I thought it was simply a permissions issue on the folders so tried setting them to 777, my next thought was to look at php.ini but everything from post value / max upload & executive times are all set within reasonable limits that should not prevent any files uploading.

Could it be something to do with the Open Base Directory?

I am really running out of idea's.

Best Regards,

Mark
Reply
Thanks given by:
#2
RE: PHP Can't Seem to Upload
Greetings fitzuk,
Please provide us more information in order to help you.
- What php.ini are you editing?
- What is exactly the error you get?
- What's the directory structure you have? (to check if it is not OpenBaseDir, but I doubt it is).
- What is your php.ini php_value post_max_size value?
My Sentora Resources
[Module] Mail Quota Count | Vagrant Box with Sentora

[Image: vanguardly-logo-micro.png]
Graphic and Web Design. Development.
www.vanguardly.com


Reply
Thanks given by:
#3
RE: PHP Can't Seem to Upload
Hey,

Thanks for getting back to me.

I am editing the etc/php.ini

I have also tried adding a php.ini in the root off the domain directory setting the values. I am pretty sure I am editing the correct file as I created a simple phpinfo file and the values I changed were updated within that.

Not sure what you mean by directory structure, I have kept it pretty standard.

The values I set are (just to be sure):

upload_max_filesize = 250M
post_max_size = 250M
max_execution_time = 300

I created a simple php upload script outside of any CMS & its almost like it thinks the file is empty or not an image.

Warning: getimagesize(): Filename cannot be empty in . . .

But inside Joomla, it thinks the files are not images by saying "vmError: Sorry,It's not a valid media file"

Any help would be greatly appreciated.

Mark
Reply
Thanks given by:
#4
RE: PHP Can't Seem to Upload
1. php.ini don't work in website root like cpanel, as php runs using mod_php5 not in php CGI mode!

2. centos 6.5 ships with php 5.3, while latest joomla require php 5.4. Take care over this.

3. Take care for openbase_dir and temp directory.

4. did you add caching or any such into VPS?

5. Check PHP Error logs for the domain under /var/sentora/logs/domains/{mydomain} that would help a lot.

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask
Freelance AWS Certified Architect & SysOps// DevOps

10$ free to start your VPS
Reply
Thanks given by:
#5
RE: PHP Can't Seem to Upload
I cleared the log and ran the simple upload script and nothing is in the log. I am aware of the latest version being 5.4 but 2.5 works fine.

Any other ideas of where I can check. Its almost like it doesnt think its an image. Could it be anything to do with suhosin
Reply
Thanks given by:
#6
RE: PHP Can't Seem to Upload
It can be suhosin too.... but strange not log error.

Basic hosting should have no issue with upload, otherwise everybody will notice it, and you will see a lot of bugs complains here.

Did you add anything php plugin in your LAMP stack? Any modifications?
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask
Freelance AWS Certified Architect & SysOps// DevOps

10$ free to start your VPS
Reply
Thanks given by:
#7
RE: PHP Can't Seem to Upload
I had same error, can not upload in both joomla and wordpress source code. My server is centos 5.7 and php 5.4.45.
Reply
Thanks given by:
#8
RE: PHP Can't Seem to Upload
(10-16-2015, 02:58 PM)td2000 Wrote: I had same error, can not upload in both joomla and wordpress source code. My server is centos 5.7 and php 5.4.45.

Did you check the permissions for the folders the files are being uploaded too?
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#9
RE: PHP Can't Seem to Upload
(10-16-2015, 05:50 PM)TGates Wrote:
(10-16-2015, 02:58 PM)td2000 Wrote: I had same error, can not upload in both joomla and wordpress source code. My server is centos 5.7 and php 5.4.45.

Did you check the permissions for the folders the files are being uploaded too?


The permission is ok.
As some guy refer to suhosin, I check with php - v as results as follow:

# php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/suhosin.so' - /usr/lib/php/modules/suhosin.so: undefined symbol: php_checkuid in Unknown on line 0
PHP 5.4.45 (cli) (built: Sep 30 2015 15:09:38)
Copyright © 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright © 1998-2014 Zend Technologies

What is problem?
Reply
Thanks given by:
#10
RE: PHP Can't Seem to Upload
do you have update your php to a new version
Sentora 1.0.3 on [Image: DO_Logo_Horizontal_Blue-3db19536.png]

-= Github =-  -= My Repo =-

My Modules
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
PHP Upload limit Crunchn 7 25 ,992 07-25-2019, 09:04 PM
Last Post: amandajames
Webpage not updating after I upload new files Zreddx 2 5 ,973 04-18-2018, 05:26 AM
Last Post: TGates
Increase MYsql file size Upload testing 18 40 ,388 12-01-2017, 09:21 PM
Last Post: Alex Lewis

Forum Jump:


Users browsing this thread: 1 Guest(s)