To my knowledge, there's no limit to the size of a single variable in PHP. There is, however, a limit to how much memory a single instance of a running script can use, which is set in PHP.ini. I think the default is 8MB. See "Resource Limits" on this page
Concerning MySQL, the amount of data you put in a column depends upon the column type. The largest column type in MySQL is LONGBLOB/LONGTEXT, and it can hold up to 2^32 bytes, or about 4.3GB (yes, gigabytes).
So, unless you're storing really big images, you shouldn't have any trouble.