Showing posts with label php Issues. Show all posts
Showing posts with label php Issues. Show all posts

Friday, July 25, 2014

how to increase limit of max input vars in php.ini

To increase in max_input_vars in php.ini follow the steps below.

  • SSH server as root user.
  • Locate you php.ini file commonly it is in /usr/local/lib/
  • vi /usr/local/lib/php.ini
  • search line max_input_time if doesn't exist add it, 5000 is the value i have used.
  • max_input_time = 5000
  • Save and exit
  • Restart httpd service
  • service httpd restart

Check current settings for max_input_vars, We can also check the same using phpinfo for steps to create phpinfo file refer the link.

=======
root@server [~]# php -i | grep max_input_vars
max_input_vars => 5000 => 5000
=======

In above case 5000 is the value set in the php.ini, Any changes made in php.ini are server wide.

Monday, January 06, 2014

How to create phpinfo file to check the php values

You can use a phpinfo();  page to view the current PHP information for your server,This file outputs a large amount of information, such as:
  • Information about PHP compilation options and extensions
  • PHP version
  • Server information and environment (if compiled as a module)
  • PHP environment
  • OS version information, paths, master and local values of configuration options
  • HTTP headers
  • PHP license
Create a phpinfo.php file and insert the below code in that file 


<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
  1. Upload the file to the server. You should upload your file to the exact directory you want to test. Typically, this will be(/home/username/public_html)
  2. Visit the page in your browser. If you uploaded it to your html directory, you should now visit http://www.example.com/phpinfo.php, here example.com is your own domain name.
  3. Now you can view all of the information about PHP for your server for that particular directory.

Sunday, November 24, 2013

How to set magic_quotes_gpc = Off in PHP WHM Cpanel


Login to  WHM -> SOFTWARE -> update Apache-> unchecked Php magic quotes.

Click "Start Build" and wait for rebuild to complete and you are done.

Check Status of magic_quotes_gpc from phpinfo() if you can see magic quotes is still on.

Forget WHM just edit the php.ini file.

If you are not able to find php.ini use the command below.

find / -name php.ini

once you locate it open it in a editor and set magic_quotes_gpc = Off
that file will look some thing like below.

Magic quotes for incoming
magic_quotes_gpc = Off

Friday, September 20, 2013

Thursday, September 19, 2013

How to Install and Configure PHP in centOS

yum install php

(above command installs the default compatible version according to that system)


/etc/php.ini

(Configration file of php from we here we can configure php according to our needs you can change memory_limit , upload_max_filesize, post_max_size)



php –i (Check current valus of php)



/usr/local/cpanel/bin/rebuild_phpconf –current


(Provides details of PHP handlers in the server.)



php -v


(To know the version of PHP installed in the server)