Trying to follow the guideline for v4 app installation, but facing problem

I’m trying to get myself a working deb file on v 4.00.00-607 following

http://community.wd.com/t5/WD-My-Cloud/GUIDE-Building-packages-for-the-new-firmware-someone-tried-it/td-p/768007/page/2

so as a start I tried building apache2 2.4.10, which gave me 2 folders(apache2-2.4.10, binutils) and loads of deb files.

Then I copied them to /deb , which is a new directory I created from WinSCP, then put in this commend on putty:

dpkg -i /deb/apache2_2.4.10-1_armhf.deb

but what I got was like this:

dpkg: warning: files list file for package 'libssh2-1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxau6:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblockfile1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libkrb5-3:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libwrap0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtagc0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libapr1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcap2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libglib2.0-0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgphoto2-port0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpng12-0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtalloc2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libevent-2.0-5:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libedit2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libldap-2.4-2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libavahi-client3:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgphoto2-2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtag1c2a:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblua5.1-0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpkcs11-helper1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpcre3:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libdb5.3:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libavahi-common3:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsensors4:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libx11-6:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnfsidmap2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libbsd0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libavahi-common-data:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libjpeg8:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnss-winbind:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsasl2-2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsasl2-modules:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcurl3:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libaprutil1-ldap:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtirpc1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libaprutil1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libkrb5support0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'librtmp0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpcap0.8:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libdevmapper1.02.1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libexpat1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libltdl7:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libkeyutils1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libreadline5:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libantlr3c-3.2-0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libasound2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxcb1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtdb1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxpm4:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtag1-vanilla:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblzo2-2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libogg0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libaprutil1-dbd-sqlite3:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libfontconfig1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libmagic1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libk5crypto3:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgssglue1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libjson-c2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libunistring0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libwbclient0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libfuse2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgssapi-krb5-2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libparted0debian1:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgd2-xpm:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libconfuse0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libexif12:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libffi5:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libflac8:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libdbus-1-3:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxml2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libfreetype6:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxdmcp6:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpam-cap:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpam-winbind:armhf' missing; assuming package has no files currently installed
(Reading database ... 24502 files and directories currently installed.)
Preparing to replace apache2 2.4.9-1 (using .../deb/apache2_2.4.10-1_armhf.deb) ...
Unpacking replacement apache2 ...
dpkg: error processing /deb/apache2_2.4.10-1_armhf.deb (--install):
 trying to overwrite '/etc/apache2/apache2.conf', which is also in package apache-php-webdav 02.00.01-145986
24869 (process ID) old priority 0, new priority 0
[ok] Restarting web server: apache2 ... waiting ..
Processing triggers for man-db ...
Errors were encountered while processing:
 /deb/apache2_2.4.10-1_armhf.deb

 So the question is, am I right in thinking that apache-php-webdav 02.00.02-145986 is preventing the apache2 from getting updated by holding apache2.conf file?

If so, is apache-php-webdav 02.00.02-145986 default app on WD My Cloud that I’m not supposed to uninstall, or can I just uninstall it and get on with it?

Those errors are normal as the package list has been modified by WD. If you uninstall webdav, you will lose remote access functions. Why would you want to upgrade apache? Trying to install php-mysql? That’s my case of dealing with the dependencies.

You can use the --force-??? option during the install to get your way around but don’t remove or replace any other packages. You then have to figure out later during runtime if there’s errors about missing dependencies…

I was first trying to make a web photo album so that I can share my photos in more organized form, view only, and found this blog recommending piwigo( http://piwigo.org). This required mysql, but I had already upgraded to firmware 4.00.00-607. I could have downgraded the firmware - that would have saved me a lot of trouble - but I thought I just don’t want to.

So, yes, I saw your comment on that package build thread saying

1. Upgraded to Apache2 2.4.10 to fix some of PHP5’s mod load issues.

2. Upgraded to PHP5 5.6.0 just to get php5-mysql and have it working.

  1. Installed MySQL Server/Client 5.5.38, this was perfect once Apache2 and PHP5 configured correctly.

and tried to do the same thing.

OK, so I force installed the thing and it seemed to work, but the command apache2 -v still returned 2.4.9.

Server version: Apache/2.4.9 (Debian)
Server built: May 3 2014 13:50:30

 Then I tried installing apache2 2.4.10 again, this time without force option, which returned dependency problem for apache2-bin and apache2-data, so I installed them first(their .deb files were also made in the compiling).

After that, I put in install command for the apache2 2.4.10 again, which was a success. It now says

Server version: Apache/2.4.10 (Debian)
Server built: Sep 26 2014 11:35:55

Currently compiling php5, is there anything that I have done that can go wrong?

P.S. I see that new firmware is out, will the debs I’ve made work in that firmware? Memory size hasn’t changed AGAIN, right?

After installing, use “dpkg - l |grep packagename” to confirm its good. On the 1st column is the status, “ii” means you’re good to go. But this only indicates your installation is ok, during apache run time you need to watch out for any dependency errors. But as long you’re force installing those 3 apache/php5/mysql with the version I indicate, should have no issues with the dependencies. If I recalled correctly (I’m typing from my mobile), you need to take note of below:

  1. Ensure only one prefork mtm module is enabled. Use “a2enmod/a2dismod module” appropriately.

  2. When you force install, there’ll be a default.conf created in the daemon’s conf dir, just rename or remove this else apache won’t run.

For the latest v4 firmware released few days back, I haven’t installed but downloaded and checked the img, it’s the same 64K page size memory. So you’re hard work won’t go wasted :smileyvery-happy:

I can’t build php5, facing dependency problem during the building process.

I typed in ./build.sh php5, and during the build process, mysql server is turned off and then tries to turn back on, which fails,

and it says it couldn’t process mysql-server and mysql-server-5.5 because mysql-server depends on mysql-server-5.5 and mysql-server-5.5 has not been configured.

What should I do to properly build php5?

Means you still haven’t resolve the mysql installations. Use “dpkg -l|grep mysql” and see those mysql related entries not marked as “ii”, then force reconfigure them or just force reinstall from the debs.

dpkg command could not be used because that’s for checking .deb files, and my problem was that .deb files weren’t made to check with…but thanks for the comment.

I solved the problem by building mysql-5.5 before building php5, but actually have no idea why that solved the problem.

That and with other depending packages built and installed, I’ll now move on to setting up mysql.

P.S. note for anyone who tries to build and install php5 in the future: building libsystemd-daemon0 returned dependency problem for 18 packages:(, but building whole systemd package didn’t return any dependency problems and libsystemd-daemon0 was built just fine.


Sarka wrote:

dpkg command could not be used because that’s for checking .deb files, and my problem was that .deb files weren’t made to check with…but thanks for the comment.


I don’t understand this part. Why it could not be used? “dpkg -l” is to list out all installed packages, “dpkg” -i is to install deb files.


Sarka wrote:

I solved the problem by building mysql-5.5 before building php5, but actually have no idea why that solved the problem.


Yes because php5-mysql needs mysql to be installed 1st.


Sarka wrote:

P.S. note for anyone who tries to build and install php5 in the future: building libsystemd-daemon0 returned dependency problem for 18 packages:(, but building whole systemd package didn’t return any dependency problems and libsystemd-daemon0 was built just fine.


Strange, I didn’t recall trying to build libsystemd, its not even on my package list now while I have also upgraded apache2, php5 and mysql installed. Anyway glad you succeeded.

As for why dpkg -l could not work, I faced problem in Virtual box, not in WDMC - I wasn’t installing the package in WDMC, I was building the package in Virtual box. dpkg -l is useful for installed packages, but not for errors during build process.

and as for libsystemd-daemon0, error messages I faced were like these:

# dpkg -i /deb/php5_5.6.0+dfsg-1_all.deb

dpkg: dependency problems prevent configuration of php5:
 php5 depends on libapache2-mod-php5 (>= 5.6.0+dfsg-1~) | libapache2-mod-php5filter (>= 5.6.0+dfsg-1~) | php5-cgi (>= 5.6.0+dfsg-1~) | php5-fpm (>= 5.6.0+dfsg-1~); however:
  Version of libapache2-mod-php5 on system is 5.5.11+dfsg-3.
  Package libapache2-mod-php5filter is not installed.
  Package php5-cgi is not installed.
  Package php5-fpm is not installed.
 php5 depends on php5-common (>= 5.6.0+dfsg-1~); however:
  Version of php5-common on system is 5.5.11+dfsg-3.

# dpkg -i /deb/php5-fpm_5.6.0+dfsg-1_armhf.deb

dpkg: dependency problems prevent configuration of php5-fpm:
 php5-fpm depends on libsystemd-daemon0 (>= 31); however:
  Package libsystemd-daemon0 is not installed.
 php5-fpm depends on init-system-helpers (>= 1.18~); however:
  Package init-system-helpers is not installed.

So I built libsystemd-daemon0…

By the way, after installing libapache2-mod-php5 I can’t access my dashboard. Did anyone face the same problem?

It was okay when I installed libonig2 and php5-common, but then I installed libapache2-mod-php5 and it went off.

Arh ic, I was referring for using “dpkg -l”, is to find out which package you already installed successfully on WDMC. If installed successfully, the 1st column should be displayed as “ii”.

As for libsystemd-daemon0, I don’t need it as I didn’t install php5-fpm. I didn’t install all the php packages. Below are the only ones installed on mine:

dpkg -l|grep php
ii apache-php-webdav 02.00.01-145986 all Apache, php, webdav, with WD configuration
ii libapache2-mod-php5 5.6.0~rc2+dfsg-5 armhf server-side, HTML-embedded scripting language (Apache 2 module)
ii php-apc 4.0.6-1 all APC User Cache for PHP 5 (transitional package)
ii php-pear 5.6.0~rc2+dfsg-5 all PEAR - PHP Extension and Application Repository
ii php5 5.6.0~rc2+dfsg-5 all server-side, HTML-embedded scripting language (metapackage)
ii php5-apcu 4.0.6-1 armhf APC User Cache for PHP 5
ii php5-cli 5.6.0~rc2+dfsg-5 armhf command-line interpreter for the php5 scripting language
ii php5-common 5.6.0~rc2+dfsg-5 armhf Common files for packages built from the php5 source
ii php5-curl 5.6.0~rc2+dfsg-5 armhf CURL module for php5
ii php5-intl 5.6.0~rc2+dfsg-5 armhf internationalisation module for php5
ii php5-json 1.3.5-3 armhf JSON module for php5
ii php5-mysql 5.6.0~rc2+dfsg-5 armhf MySQL module for php5
ii php5-sqlite 5.6.0~rc2+dfsg-5 armhf SQLite module for php5

As for the dashboard, take a look at the apache error log when you try to access it. There could be clues. Is libapache2-mod-php5 installed successfully? Try create a test.php in the ht root eg. /var/www/htdocs/test.php:

<?php
	phpinfo();
?>

 Then try access http://wdmycloud/test.php.

There are two types of errors occuring on apache error log:

PHP Fatal error: Call to undefined function Core\\apc_fetch() in /var/www/rest-api/api
PHP Fatal error: Call to undefined function curl_init() in /var/www/htdocs/UI/lib

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/apcu.so' - /usr/lib/php5/20131226/apcu.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/curl.so' - /usr/lib/php5/20131226/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/json.so' - /usr/lib/php5/20131226/json.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/pdo_sqlite.so' - /usr/lib/php5/20131226/pdo_sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/sqlite3.so' - /usr/lib/php5/20131226/sqlite3.so: cannot open shared object file: No such file or directory in Unknown on line 0

Those are the hints. You’ll need (named roughly as I’m posting from mobile, think the apc* you’ll need to force install due to webdav):

  1. Php5-apc

  2. Php5-apcu

  3. Php5-curl

  4. Php5-json

  5. Php5-pdo_sqlite

  6. Php5-sqlite