THE IT IDEAS

  • Home
Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Thursday, 20 August 2015

PHP Warning: shell_exec() has been disabled for security reasons

 THE IT IDEAS     18:03     php   



PHP Warning: shell_exec() has been disabled for security reasons

To start shell command execution in php code you need to edit php.ini and remove "shell_exec" from disable_functions line. below is the example of line

disable_functions = show_source,system,shell_exec,proc_open

to

disable_functions = show_source,system,proc_open

After remove the "shell_exec" save the php.ini file and Restart webserver.

Its done Enjoy !!!! :)


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Thursday, 30 April 2015

How to run a simple PHP web server

 THE IT IDEAS     13:12     apache2, php   

# php -S localhost:8000 -t /path/to/folder/directory

Above command give output like below

PHP 5.6.4-4ubuntu6 Development Server started at Thu Apr 30 15:10:00 2015
Listening on http://localhost:8000
Document root is /var/www/html
Press Ctrl-C to quit.


Now you can open the localhost:8000 in your browser to check the webpage.

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Thursday, 11 December 2014

Installation and configuration of GeoIP module in php

 THE IT IDEAS     15:13     geoip, php   

After installation of Apache2 and php follow below step to achive country wise redirection.

#apt-get install libapache2-mod-geoip

Edit geoip.conf file and uncomment mentioned line.
#nano /etc/apache2/mods-available/geoip.conf

<IfModule mod_geoip.c>
  GeoIPEnable On
  GeoIPDBFile /usr/share/GeoIP/GeoIP.dat        <-- uncomment this line with remove # from starting of line.
</IfModule>

save and exit. Once restart apache server

#/etc/init.d/apache2 restart

Now, Make one file to test.

#nano /var/www/html/example.php

Enable mod rewrite module in php

#a2enmod rewrite

Again restart the apache server.

#service apache2 restart

Edit default apache host file and add below mentioned lines before </VirtualHost> tag to redirect url country wise.
#nano /etc/apache2/sites-available/000-default.conf 


<IfModule mod_geoip.c>
GeoIPEnable On
GeoIPDBFile /usr/share/GeoIP/GeoIP.dat
</IfModule>
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^IN$
RewriteRule . /example.php [L]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^DE$
RewriteRule . /2.php [L]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^US$
RewriteRule ^(.*)$ http://www.yahoo.com$1 [R,L]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA$
RewriteRule ^(.*)$ http://www.google.com$1 [R,L]


Save and exit. Once restart apache server.
#service apache2 restart



Brief Information about the lines.

1)  RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^IN$
     RewriteRule . /example.php [L]

Above line will redirect your default page to example.php in your root directory (html folder) If opened with INDIAN IP.

2) RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^DE$
    RewriteRule . /2.php [L]

Above line will redirect your default page to 2.php in your root directory (html folder) If opened with GERMANY IP.

3) RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^US$
    RewriteRule ^(.*)$ http://www.example.co.us$1 [R,L]

Above line will redirect your default page to another URL. If opened with US IP.


4) RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA$
    RewriteRule ^(.*)$ http://www.google.com$1 [R,L]

Above line will redirect your default page to another URL. If opened with CANADA IP.



Use your desire setting to achive your goal !!
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Older Posts Home

Like Us !!!

Recent Posts

Blog Archive

  • ▼  2016 (1)
    • ▼  April (1)
      • How to Install PHP 7.0, Apache 2.4.18, & MySQL 5.7...
  • ►  2015 (12)
    • ►  August (1)
    • ►  May (2)
    • ►  April (8)
    • ►  March (1)
  • ►  2014 (23)
    • ►  December (8)
    • ►  November (12)
    • ►  April (2)
    • ►  March (1)
  • ►  2013 (7)
    • ►  December (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (3)
  • ►  2012 (15)
    • ►  December (6)
    • ►  November (9)

Categories

apache2 EC2 error mysql php ubuntu aws aws rds browser github installation linux mount s3 AWS Bucket CentOS Computer DocumentRoot change How to Benchmarking Webserver IP LAMP Restart Computer SCP command SQL SERVER XRDP administrator amazon rds backup basic commands chat command line disable download drupal ec2.chroot environment external storage device fstab functions geoip gmail google home page iis instance internet java mod rewrite mongodb multiple login network password one password php5 php5-fpm php7 private browsing python repair filesystem repo reset password rhel sa password same computer script sftp share skype ssh tomcat ubuntu 16.04 ubuntu16 visudo windows 8 youtube
JobsMagBlogJobsMag.InThingsGuide

Popular Posts

  • PDOException: SQLSTATE[42000]: 1148 The used command is not allowed with this MySQL version in AWS RDS
    To Resolve this error you have to connect mysql with below command then you can able to run LOCAL INFILE command in mysql console or drupal...
  • How to make Google Chrome Theme
    Open Google Chrome and open Chrome web store and search my chrome theme Click on Add to Chrome     Click on Add to downloadi...
  • How to disable Username and Password in Network pc
    1. Click Start 2. Control Panel 3. Network and Internet 4. Network and Sharing Center 5. Click Choose homegroup and sharing options...

Copyright © THE IT IDEAS | Powered by Blogger