[php] PHP uploading problem

When you have problem with uploading large file to your PHP application, try to change below options in /etc/php.ini


;php.ini
max_execution_time = 0 ; unlimited
max_input_time = 0
memory_limit = 8M

;Maximum size of POST data that PHP will accept.
post_max_size = 240M ; Set this value to max upload file size that you want

file_uploads = On

; Maximum allowed size for uploaded files.
upload_max_filesize = 240M ; Set this value to max upload file size that you want

Also, if you use Apache 2.0 (Redhat) check if httpd.conf or /etc/httpd/cond.d/php.conf contains below option


LimitRequestBody 0 ; unit is bytes and 0 means unlimited.

Read More

[php] module compilation:Payflow Pro Verisign

I have my php already compiled and working perfectly, but I found that pfpro module was not compiled in.

I needed pfpro module, but I didn’t want to mess up with whole php recompilation…

First download linux SDK kit from verisign website. You need to create an account with verisign first.

Unzip/untar into /var/www/pfpro

So I decided with creating self-contained pfpro module.

1. make a directory and cd into it.
$mkdir mydir
$cd mydir

2. copy all files from php_source_dir/ext/pfpro to the new dir

$cp -rp /usr/src/redhat/SOURCES/php-x.x.x/ext/pfpro/* .

3. if you are using redhat, you need to install php-devel rpm package
Run

$phpize

4. Run
(php-config resides /usr/bin with redhat RPM, so you don't
need --with-php-config. /usr/bin is already in ENV)

$./configure --with-pfpro=shared,/var/www/pfpro/lib \
[--with-php-config=/path/to/php-config]

5. $make

6. $cp ./modules/pfpro.so /usr/lib/php4

7. insert below line into /etc/php.ini

extension=pfpro.so

8. restart httpd server

9. check with phpinfo()

NOTE: When you actaully code the php, you need to set environment variable n the php file before connecting to verisign. Of course you must provide the correct path.
putenv(“PFPRO_CERT_PATH=/var/www/pfpro/certs”);

Read More