Hi all,
I write this tutorial that explains how to install PHP on the vera’s webserver.
So you can install your php website (like control interfaces) directly on your vera (such as the excellent MyVera).
WARNING
This tutorial (unlike the usual tutorial) requires to add and edit files directly inside the vera. There is nothing complicated if you follow this tutorial.
But I must warn you that these things can cause a “crash” of your vera and neither micasaverde and I can be held responsible for this.
INFO:
This is a specially compiled version of PHP for vera and reduced to a minimum to reduce the memory footprint flash and ram.
So there is a lot of features that are missing such as mysql functions. In contrast curl, json and GD support is present
Another point for those familiar with PHP: PHP errors do not appartront and cause a 500 error (Internal server error). To see the php error that triggered this, we must look at the lighttpd log in “/var/log.lighttpd_error”
PREREQUISITE:
You need a vera (preferably “light” for better performance)
Copy the file “php4vera-xxxxxx.tgz” in the “/tmp” vera’s folder with your winscp software (SCP protocol).
STEP 2: Installing Package
open a terminal using ssh and run the following commands:
cd /tmp
tar xvzf php4vera-20120108.tgz
cd /tmp/php4vera-20120108/
cp -R * /
cd /usr/lib/
ln -s libcurl.so.4.3.0 libcurl.so.4
Step 3: Configuring lighttpd web server
Edit the file “/etc/lighttpd.conf” (either directly ssh with “vi” or you can download it with winscp, make your changes and send it back to your vera).
At the beginning of the file, remove the “#” in front of them: “mod_alias” and “mod_fastcgi”.
If there is no message that appears is that the server is restarted. To test that PHP works well, open your browser and enter: http:///phpinfo.php
You should see the status page of PHP.
Voila, you have PHP installed on your vera webserver
I’m trying to install this and my vera seems to hang at the following point
root@MiOS_16029:~# cd /tmp
root@MiOS_16029:/tmp# tar xvzf php4vera-20120108.tgz
php4vera-20120108/
php4vera-20120108/etc/
php4vera-20120108/etc/php.ini
php4vera-20120108/www/
php4vera-20120108/www/phpinfo.php
php4vera-20120108/usr/
php4vera-20120108/usr/bin/
php4vera-20120108/usr/bin/php-cgi
php4vera-20120108/usr/lib/
php4vera-20120108/usr/lib/libfreetype.so.6
php4vera-20120108/usr/lib/libpng15.so.15
php4vera-20120108/usr/lib/libcurl.so.4.3.0
php4vera-20120108/usr/lib/libjpeg.so.8
php4vera-20120108/usr/lib/lighttpd/
php4vera-20120108/usr/lib/lighttpd/mod_fastcgi.so
php4vera-20120108/usr/lib/lighttpd/mod_alias.so
root@MiOS_16029:/tmp# cd /tmp/php4vera-20120108/
root@MiOS_16029:/tmp/php4vera-20120108# cp -R * /
root@MiOS_16029:/tmp/php4vera-20120108# cd /usr/lib/
root@MiOS_16029:/usr/lib# ln -s libcurl.so.4.3.0 libcurl.so.4
root@MiOS_16029:/usr/lib#
at this point putty becomes extremely slow key presses take 30 seconds or more to register i cannot login with winscp it just times out the connection attempt.
I’m not sure what you mean with the “gf -h” command. I am not very savvy when is comes to this. I had to try installing several times and the vera would become unresponsive after the “tar xvzf php4vera-20120108.tgz” command (no SSH, winscp, or ui5) and had to unplug the vera. I would let it sit for over 30 minutes just to make sure it would not come back. The log i posted above was the only time I could get that far.
After the reboot I checked that the files were in the proper places according with the log, but after modifying the lighttpd.conf (winscp method) i would loose any access to the UI5 interface and going to the phpinfo.php would fail to connect with the server. If i replace the lighttpd.conf with the original every thing comes back in UI5.
Am viewing this as a learning experience since I don’t have hardly any experience with SSH or linux commands.
Edit: It seems that if i remove the # from the “mod_alias” or “mod_fastcgi” causes instant loss of the UI5 I can still SSH and Winscp in to the vera to revert the changes ang can use the vera again.
I also noticed that there is a lighttpd.conf file in the “ect/tighttpd” folder do i need to make these changes there instead of the one inside the “ect/” folder?
Maybe the vera2 has less ram memory than the vera light and the “/tmp” is a ramfs. So when it will become full, the vera free ram memory will be null and will crash (or going reaalllyyyyy slloooowwww).
The “df -h” command will tell you how disk space you have and the “free” command will tell you how free memory you have.
You can find a tips to copying files one by one and putting them in the right place on your vera.
An other solution is to plug an USB key to your vera and copy files on it.
Your Vera interface crahes because all files needed for pho are not installed.
If you have no free space the only solution you have is to put them on an USB key plugged in your Vera. (or to buy the Vera light)
[quote=“psykokwak, post:13, topic:173836”]Your Vera interface crahes because all files needed for pho are not installed.
If you have no free space the only solution you have is to put them on an USB key plugged in your Vera. (or to buy the Vera light)[/quote]
that makes sence.
I dont supose there is a guide on how to get this running on a usb? (sigh) I’m more of a hardware guy than a programmer.
I also need this help. In the directions above, what do you change or where do you place the files to get them on USB drive? I have two USB drives attached to Vera2 for Datamine and for Log/Swapfile (although, after looking at the df -h output, I’m now wondering if Vera put the log files on the Datamine USB drive instead of the newer drive that I attached).