39

I just moved magento from local to server and Im getting the following error, I was just wondering if someone could help me solve this,

UID of script "/home/.../public_html/index.php" is smaller than min_uid

what I did was to make a database dump and transfer it to server,

create a backup of the all the magento files and transfer and expand to server,

change the core_config table in the database.

Thanks in advance.

akano1
  • 40,596
  • 19
  • 54
  • 67
  • Where is that error from? Syslog? SELinux? – hakre Mar 14 '12 at 22:19
  • sorry Im not sure what the question is but on the page it says suPHP 0.6.1, the error shows up when I go to the index.php page, http://www.magento-domain/index.php – akano1 Mar 14 '12 at 22:21
  • The error shows up in the page with a "Warning:" in front and some file given and a line number where the error occured? Is it an error given by the PHP interpreter or by the webserver? – hakre Mar 14 '12 at 22:33
  • 1
    the error is given by the webserver, it's not a php error. – akano1 Mar 14 '12 at 22:43
  • I'm searching in google and I found in one place that because the file is owned by root this error happens, if this is the case, what should I do? thanks – akano1 Mar 14 '12 at 22:44
  • Thank you. I got this error when using a `composer` command to install CakePHP from my root account. These answers worked to solve that. – ShawnPConroy Apr 28 '15 at 11:49

5 Answers5

46

That looks like an suPHP issue to me.

Change the user and group of your script to the user running your webserver process. So if you're running an Apache with user www-data for example, change to:

chown www-data:www-data /home/.../public_html/index.php

Or change all your files at once by:

chown -R www-data:www-data /home/.../public_html/

If you're still running into this issue after changing user and group, then your suPHP is probably working with the default min_uid = 100, but the UID of www-data is below this 100.

To fix this you can change the min_uid in suPHP's config to match the UID of www-data:

vi /etc/suphp/suphp.conf

min_uid = <UID of www-data>
Jürgen Thelen
  • 12,745
  • 7
  • 52
  • 71
  • Don't forget to change min_gid in the same suphp.conf file as well. I had to fix that to make it work. – HZhang Jul 12 '15 at 05:44
  • For a file uploaded via WinSCP, we can't be lazy and `chown` on the folder. We should do it directly to the file. Check if `chown` already works by running command `ls -lah` – Aminah Nuraini Feb 19 '17 at 20:01
19

If your script is owned by root, you should change the ownership back to yourself:

chown -R user /home/user/public_html

This will change the owner of all of the files contained in /home/user/public_html and all subdirectories to user.

Martin
  • 5,945
  • 7
  • 50
  • 77
  • 1
    Hi, thanks for the reply, but I dont think that's the case because I still get the same problem. – akano1 Mar 14 '12 at 23:27
6

I had same problem, and fixed it with logged in Ftp and uploaded files with cpanel account of this site. Not root or admin account. You must create or edit your files with this account.

agenc
  • 322
  • 4
  • 10
5

What I did to fix this problem:

chown -R user:user /home/dibs/public_html

and made the php files to chmod 700

Klevis Miho
  • 851
  • 8
  • 15
1

as far as i am getting just disable the suPHP mode in apache2, by typing this command on terminal : sudo a2dismod suphp

if you want to enable it again : sudo a2enmod suphp

Deepanshu Jain
  • 558
  • 4
  • 5