PHP move_uploaded_files permission denied

This turned out to be a fairly simple fix after much frustration.

I did this in ssh, so if you don’t have that, you’ll have to find another article.

open ssh, cd to your web root.

type ls -l

to see all the permissions.  You’ll see come stuff like -rw-ww- owner group 4096 time filename

you’ll need to change your upload directory to have the same group and owner as your other web files.

So let’s get started

mkdir data

chown owner

chgrp group

chmod 777 data

That’s it.

replace “data” with your folder name

replace “owner” and “group” to match the settings from when you did ls -l

Simple Invoice, Gmail/Google Apps, SMTP and PHP

Using Gmail as an SMTP server can be a pain if you don’t know what you are looking for.  Fortunately, there are some decent tutorials online that can get you there….more or less.

I just wanted to recap my experience when trying to use Google Apps as my SMTP server when setting up Simple Invoice…..

1) Get the latest PHPMailer from http://phpmailer.worxware.com/.  Install accordingly.

2) Compile OpenSSL for PHP.  If on windows simply delete the semi-colon (;) in front of ;extension=php_openssl.dll in php.ini

3) When making calls to phpmailer, the host should be ssl://smtp.gmail.com, the port should 465, username should be your full email address and of course your password.   If the phpmailer version requires the input, SMPT_AUTH should be true.

That should be it.

For those using Simple Invoice, you can set your config.ini file to look like this:

email.host = ‘ssl://smtp.gmail.com’
email.smtp_auth = true
email.username =  test@gmail.com
email.password =  password
email.smtpport = 465
email.secure       =
email.ack     = true

Hope that helps someone.  If you have any questions, just comment and I’ll get back with you.