PHP

The best way to find php.ini and Edit php.ini?

The best way to find php.ini in used to use this command.

Quote:
root@gnu [~]# php -i | grep php.ini
Configuration File (php.ini) Path => /usr/local/Zend/etc/php.ini

 

Enabling curl with XAMPP on Windows XP , Vista

To enable curl library with XAMPP we need to modify the php.ini files in our xampp folder.

1) Locate the following files in XAMPP folder Installation:

 

C:\Program Files\xampp\apache\bin\php.ini
C:\Program Files\xampp\php\php.ini
C:\Program Files\xampp\php\php4\php.ini

2) Uncomment the following line on your php.ini file by removing the semicolon.

;extension=php_curl.dll
extension=php_curl.dll

3) Restart your apache server.

4) Check your phpinfo output if curl was properly enabled.

 

way to change max_allowed_packet mysql php

way to change max_allowed_packet

mysql> show variables like 'max%' ;

+-----------------------+------------+
| Variable_name         | Value      |
+-----------------------+------------+ | max_allowed_packet | 1048576 |
... mysql> set max_allowed_packet = 1500000; Query OK, 0 rows affected (0.03 sec) mysql> show variables like 'max%' ; +-----------------------+------------+ | Variable_name | Value |
+-----------------------+------------+ | max_allowed_packet | 1499136 |
...

 

Increase PHP memory limit execution time PHP

PHP.ini is  8 MB of memory configured for your server, you may need to increase this depending on how

Depending on your host, this can be done in a number of places with the most likely being php.ini or .htaccess depending on your hosting situation.

Add for example:

 

 

PHP array

An array is a mean to store collection of values in a single variable. e.g instead of creating a separate variable to store each employee's name, you can use an array to store the names of all your employees in a single variable. This is how you would do it.

$employee_names[0] = "value1";
$employee_names[1] = 10;      //No matter of data type Wow..!
$employee_names[2] = "Susan";

 

When can a session not be established in php page?

When a browser does not accept cookies.
25% (3 votes)
When PHP directive sessions_use_only_cookies has been set to 1.
17% (2 votes)
When sessions.use_trans_sid has been set to 0.
50% (6 votes)
All of the above.
8% (1 vote)
Total votes: 12

Installing phpMyAdmin on Linux PHP fedora for managing mysql databases

First things first, we need to get the latest version of
phpMyAdmin, at the time
this tutorial was written the latest stable version was 2.5.5-pl1,
and you can get it at;



The phpMyAdmin Home Page 

The Link I used:

 

php code for showing random images from an image folder based on page view

We can use PHP rand() function for showing the random data from database or from a list or directory.This code is used for showing the random images from a directory based on page refresh.Create A Page and paste below code in that.Create an image folder and place images in that which you want to show randomaly.Both images and code file should be in same folder.You can change code as per requirements.You can see working demo on http://www.indiapoly.com.

 

Sql php script to generate Drop table with prefixes mysql is helpful for drupal prefix

Yuo can be in situation for deleting many tables from database with particular prefix.I was in such a situation where

i needed to delete 200 tables from my database with prefix "vb".So i used this script for generating the drop table statement

and just copied to mysql window. and thats all.it work fine.

 

 

mod_rewrite enabling url reqriting on apache and iss server windows and linux

URL reqriting is Simple Rewriting Your URLS (links) Also Redirecting Them To Known URLS.e.g you'll make the link : view_my_profile.html --> Is Redirected to function.php?op=3
so instead of the link "function.php?op=3" Which isn't enough describing itself we'll make the link "view_my_profile.html" Which is very describtive.Why using mod_reqrite?. Now see if your site has more than 10,000 Links (Dynamic Website) , do you think we would make 10,000 html files ??

 

Syndicate content