php

PHP

php mysql blob upload download

Using PHP to upload files into MySQL database sometimes needed by
some web application. For instance for storing pdf documents or images
to make som kind of online briefcase (like Yahoo briefcase).

For the first step, let's make the table for the upload files. The table will consist of.

1. id : Unique id for each file
2. name : File name
3. type : File content type
4. size : File size
5. content : The file itself

Windows

edited httpd - added
# For PHP 4 do something like this:
LoadModule php4_module "c:/php/php4apache2.dll"
# Don't forget to copy the php4apache2.dll file from the sapi directory!
AddType application/x-httpd-php .php

# For PHP 5 do something like this:
#LoadModule php5_module "c:/php/php5apache2.dll"
#AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "c:/php/"

'administer -> modules' link fails(dead link)

Symptoms - After adding a new module the administer -> module
link fail (link is dead). When the module directory is removed the link
returns.

Solution - This is most likely a memory issue. PHP default load sets
"memory_limit = 8M" in /etc/php.ini. The more modules you add the more
memory you will need to run the module script. Change memory_limit to
20M. Requires a restart of httpd.

Ref:http://drupal.org/node/13358

"the document contains no data" or can't upload file

symptom: Im trying to use an upload image module with drupal. when i
submit the form, I get a return from the server that says "the document
contains no data" or the site goes to a dead page.

solution: Apache is set to limit php pages to a maximum of 512 KB by
default. I increased the limit to 1 GB (the LimitRequestBody directive
in /etc/httpd/conf.d/php.conf).

There are also limits on file sizes in /etc/php.ini:
post_max_size = 8M
upload_max_filesize = 2M

Configuration

configuration

Drupal 'Internal Server Error'

Symptom: 'Internal Server Error' on new install of Drupal. Removing .htaccess file solves the problem.

The .htaccess file is the only thing in Drupal that can cause an
'Internal Server Error (500)'. This is most likely caused by a
misconfigured or restricted Apache configuration (Some hosts don't
allow PHP directives in .htaccess).

Solution:

Syndicate content