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

01 March 2013

Webserver on Ubuntu 12.04

I wanted to have my own wiki on my Ubuntu.

1. install apache
sudo apt-get install apache2

2. install php
sudo apt-get install php5 libapache2-mod-php5

3. restart
sudo /etc/init.d/apache2 restart

4. test with /var/www/info.php at localhost/info.php
<?php
phpinfo();
?>


5. using home folder instead of /var/www
sudo mv /var/www /var/www-backup
sudo ln -s /home/username/Sites /var/www


And then I can have my sites also backed up on Dropbox! Yay!

Moving Pukiwiki on PHP 5.4.6

source

The frontpage was blank, I thought I was doing something wrong with my website settings.
But turns out pukiwiki wasn't working well on php 5.4 without changes.
It can be seen on the blog above, I'll rewrite it again here:

1. lib/func.php
Comment out bin2hex() function
// Inversion of bin2hex()
/* 
function hex2bin($hex_string)
{
// preg_match : Avoid warning : pack(): Type H: illegal hex digit ...
// (string) : Always treat as string (not int etc). See BugTrack2/31
return preg_match('/^[0-9a-f]+$/i', $hex_string) ?
pack('H*', (string)$hex_string) : $hex_string;
}
*/


2. plugin/ls2.inc.php
array_walk($args, 'plugin_ls2_check_arg', & $params);
to
array_walk($args, 'plugin_ls2_check_arg', $params);

It already worked at this stage, but just in case, I also did this

3. lib/convert_html.php, lib/link.php, lib/init.php
change all & new to new

When moving pukiwiki to a new server, need to do:
chmod 666 *
chown username:username *

for wiki/ backup/ diff/