Category Archives: php

password* functions before php 5.5.0

There is noway to use password_hash and password_verify and other password* functions natively with php older than 5.5.0 . You can see frustrating indication (PHP 5 >= 5.5.0) in php documentation.

If you are not the admin of php server or you don’t want to upgrade your php server right now, you are like me solved by ircmaxell who codes with contributers one file php library password.php listed bellow. Take last version found here

Simple of use : download password.php and include it in your php page and enjoy

password.php

ajax displaying jboss server state

We aim to have web page which displays continually three jboss7 servers states.
For this we need the shell script (status.sh) to be found here.

environment requirement

    servers in same machine :
  • apache server
  • three jboss7 servers: jboss1, jboss2, jboss3

get result of status.sh in our php file

Following php code displays one jboss server state

For our example we need three php files containing the previous one line php code corresponding to each one of the three jboss server : state-jboss1.php, state-jboss2.php, and state-jboss3.php

ajax state display

We need here the load() method of jquery javascript framework.

continuous update of servers state

We’ll resort to javascript timer

deloyment

    root folder :
  • create folder jboss-state in apache server root www
    files :
  • www/jboss-state/status.sh
  • www/jboss-state/index.html
  • www/jboss-state/state-jboss1.php
  • www/jboss-state/state-jboss2.php
  • www/jboss-state/state-jboss3.php

full code

status.sh (myArtifactName string in code must be replaced by the right artifact name)

state-jboss1.php

state-jboss2.php

state-jboss3.php

index.html

WordPress changes don’t take effect immediately

Changes made on php files or appearance customization don’t take effect immediately, if the wordpress cache plugin is not disabled.

Edit wp-config.php and disable cache :

Cache plugins are very helpfull. Keep cache DISABLED until you are finished any customization work.

apache2+php


April 12, 2013

apache2+php
> sudo apt-get install apache2
> sudo apt-get install php5
> sudo apt-get install libapache2-mod-php5
> sudo /etc/init.d/apache2 restart
> vi /etc/apache2/sites-available/default : modifier /var/www by your prefered folder