PHP GeoIP PECL on Fedora
December 19, 2012 Leave a comment
yum install GeoIP geoip-devel php-pecl-geoip
For database files, see: https://rewgaz.wordpress.com/2012/04/06/php5-geoip-pecl-apache2-ubuntu/
Just a few lines of code.
December 19, 2012 Leave a comment
yum install GeoIP geoip-devel php-pecl-geoip
For database files, see: https://rewgaz.wordpress.com/2012/04/06/php5-geoip-pecl-apache2-ubuntu/
December 10, 2012 Leave a comment
setsebool -P httpd_can_network_connect 1
December 10, 2012 Leave a comment
yum install httpd php php-common mysql mysql-server php-pecl-apc php-cli php-pear php-pdo php-mysql php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml phpmyadmin php-pear php-devel ImageMagick php-pecl-imagick php-bcmath
service httpd start
service mysqld start
chkconfig –levels 235 httpd on
chkconfig –levels 235 mysqld on
November 20, 2012 Leave a comment
PHP Manual: http://php.net/manual/en/function.get-browser.php
$browser = get_browser($_SERVER[‘HTTP_USER_AGENT’], true);
print_r($browser);
Download: php_browscap.ini (http://tempdownloads.browserscap.com/)
You can put the file anywhere. I placed it here: /etc/php5/apache2/php_browscap.ini
Edit your: php.ini
[browscap]
; http://php.net/browscap
browscap = “/etc/php5/apache2/php_browscap.ini”
September 26, 2012 Leave a comment
As I was in need of a memcached administration interface for my cluster setup and I didn’t find anything useful. So I decided to build my own.
I hope someone else will find my application useful. I pushed it to github:
https://github.com/rewi/memcadmin
April 6, 2012 1 Comment
Install GeoIP for PHP via PECL:
apt-get install libgeoip-dev php5-dev php5-geoip php-pear
pecl update-channels
pecl upgrade-all
pecl install geoip
Add “extension=geoip.so” to your ‘php.ini’ (at the end of the file). My ‘php.ini’ is located at ‘/etc/php5/apache2/php.ini’.
Download GeoIP Databases (if they aren’t there already):
cd /usr/share/GeoIP
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz && gunzip GeoLiteCity.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz && gunzip GeoIP.dat.gz
Unfortunately there is something wrong with the paths, so I had to rename one of the files to make it work:
mv GeoLiteCity.dat GeoIPCity.dat
You can see all database files with the following command:
<?php
var_dump(geoip_db_get_all_info());
?>
I couldn’t figure out where to change this list. Maybe I will find a way in the future…
Finally let’s see where the client is located:
<?php
var_dump(geoip_record_by_name($_SERVER[‘REMOTE_ADDR’]));
?>
September 21, 2011 Leave a comment
Update, install new software an restart Apache:
# apt-get update && apt-get upgrade
# apt-get install memcached php5-memcache
# /etc/init.d/apache2 restart
Now test it. Start a new memcache instance:
# memcached -u root -d -m 24 -l 127.0.0.1 -p 11211
This instance starts as root user using 24 MB as maximum cache size, listening on port 11211.
On my system, I have this process running now:
13919 ? Sl 0:00 /usr/bin/memcached -m 64 -p 11211 -u memcache -l 127.0.0.1
We can test our running memcache process by connecting via Telnet:
# telnet 127.0.0.1 11211
An overview of the availiable commands, you can find here: http://lzone.de/articles/memcached.htm
If you like to change your default memcached configuration, do the following:
# vim /etc/memcached.conf
Don’t forget to restart memcached afterwards:
# /etc/init.d/memcached restart
At this point you would have to start all memcached instances manually. That’s a thing I wouldn’t like to worry about. So move the commands to rc.local:
# vim /etc/rc.local
Add lines like this before ‘exit 0’:
memcached -u your-user-name -d -m 16 -l 127.0.0.1 -p 11211
Make sure every instance listens on a different port. For example: 11211, 11212, 11213… etc.
March 15, 2011 1 Comment
If you don’t have it installed already, install PEAR:
# sudo apt-get install php-pear
Install the Imagick packets:
# sudo apt-get install imagemagick libmagickwand-dev
If you don’t have the PHP5 development packet on your server, you maybe also need to install the following packet:
# sudo apt-get install php5-dev
Now we can install Imagick via PECL:
# sudo pecl install imagick
At this point we have to tell PHP to use Imagick. We can achieve this by putting the following line in the php.ini config file. Just put it at the end of the file. Mine is located at /etc/php5/apache2/php.ini.
extension=imagick.so
We’re nearly done. Restart your Apache2 server now:
/etc/init.d/apache2 restart
That’s it! 😉
December 9, 2010 Leave a comment
(Quelle: aus dem Veyton 4.0 Handbuch)
In xt:Commerce VEYTON ist es ein leichtes, eine weitere Kategoriebox anzulegen um zb Kategorien auch optisch zu Trennen (Herren / Damen zb).
Um eine neue Kategoriebox zu erstellen führen Sie folgendes durch:
1. Kopieren Sie die Datei xtCore/boxes/categories.php und benennen die kopierte Datei in categories_herren.php um.
2. Kopieren Sie die categories.html in Ihrem Template und bennenen diese ebenfalls in categories_herren.html um.
3. Öffnen Sie Ihr Template (zb index.html) und fügen {box name=categories_herren} ein.
4. Fertig, Ihre neue Kategoriebox sollte nun angezeigt werden.
Um nun in der erstellten Kategoriebox eine beschränkte Hauptkategorie mit Ihren Unterkategorien anzeigen zu lassen, öffnen Sie Ihre categories_herren.php Datei und ändern den Befel:
$category->getCategoryBox() auf $category->getCategoryBox(5)
(5 ersetzen Sie bitte durch Ihre ID der gewünschten Wurzelkategorie)