Installing Newznab on QNAP

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
User avatar
forkless
Experience counts
Posts: 1907
Joined: Mon Nov 23, 2009 6:52 am
Location: The Netherlands

Re: Installing Newznab on QNAP

Post by forkless »

I'll look at it later tomorrow, one thing I noticed I never amended is the TMP dir alteration. IF you are running MariaDB instead of MySQL then this variable no longer needs to be adjusted as the MariaDB tmp dir is now located on the array/physical disk instead of the /tmp on ramdisk.
dehli
Starting out
Posts: 35
Joined: Mon Mar 23, 2015 12:42 am

Re: Installing Newznab on QNAP

Post by dehli »

I'm just using the built-in MySQL server, and everything works great when I execute the scripts from the command line, but not at startup. Looking through the posts, it appears others have had this problem as well.

The problem is that the following command in autorun.sh doesn't run at start-up, or there is an error with it I cannot see.

Code: Select all

screen -S nab sh /share/.../update_scripts/nix_scripts/newznab_screen.sh
There is a post about the broken-ness of screen on QNAP QTS here: http://wiki.qnap.com/wiki/Screen_command
So I've tried adding the following above my screen command in autorun.sh:

Code: Select all

touch /var/run/utmp
ln -s /usr/share/terminfo/x/xterm-xfree86 /usr/share/terminfo/x/xterm-256color
ln -s /usr/share/terminfo/x/xterm-xfree86 /usr/share/terminfo/x/xterm-color
I also added full paths to screen and sh, as well as -d -m options to screen:

Code: Select all

/opt/bin/screen -d -m -S nab /bin/sh /share/.../update_scripts/nix_scripts/newznab_screen.sh
I am now seeing a log message I've put in 'newznab_screen.sh' showing up in the system log (further than I got before), but I still can't open a terminal and attach to the screen. There's nothing related to Newznab when I list screens either, so I don't think it's running. I'll report back if I make any progress.
User avatar
forkless
Experience counts
Posts: 1907
Joined: Mon Nov 23, 2009 6:52 am
Location: The Netherlands

Re: Installing Newznab on QNAP

Post by forkless »

Try

Code: Select all

/opt/bin/screen -s -dmSnab /share/path/to/script
CTRL A, CTRL D to detach then to re-attach

Code: Select all

/opt/bin/screen -r nab
dehli
Starting out
Posts: 35
Joined: Mon Mar 23, 2015 12:42 am

Re: Installing Newznab on QNAP

Post by dehli »

Thanks again forkless.

Works from the command line, but not on reboot.

What's interesting is I added a log entry just before the 'do' in newznab_screen.sh script, and it actually shows up in the system log...

Code: Select all

...
/sbin/log_tool -t 0 -a "Starting Usenet Indexing..."

 do
CURRTIME=`date +%s`
cd ${NEWZNAB_PATH}
$CMD_PHP ${NEWZNAB_PATH}/update_binaries.php
$CMD_PHP ${NEWZNAB_PATH}/update_releases.php
...
But I also have this at the bottom of the script, and it never shows up...

Code: Select all

echo "Waiting ${NEWZNAB_SLEEP_TIME} Seconds..."
/sbin/log_tool -t 0 -a "Pausing Usenet Indexing For ${NEWZNAB_SLEEP_TIME} Seconds..."

sleep ${NEWZNAB_SLEEP_TIME}
Perhaps the screen session is getting killed or exits?

On boot, it creates the folder '/tmp/screens/S-admin', but it's always empty. Unlike running it from the command line... the session in 'S-admin' is listed
User avatar
forkless
Experience counts
Posts: 1907
Joined: Mon Nov 23, 2009 6:52 am
Location: The Netherlands

Re: Installing Newznab on QNAP

Post by forkless »

The only thing I can think of is that when you fire it up from the autorun context is that you are missing some system variables such as SHELL and TERM that are a prerequisite for screen.

Alternatively you can create an QPKG entry and create an init script for it. The only thing I would advise to do on the stop signal is to check if the loop is on it's pause cycle so it can safely shut down, you really don't want to kill off the process when it's inserting binaries and/or post-processing them for meta.

The upside of using this method is that the NAS services script will now be fully aware of your app and it won't lock up during f/w updates and reboots preventing it from generating unclean volumes.
pdupreez
Starting out
Posts: 42
Joined: Wed Aug 11, 2010 12:15 am

Re: Installing Newznab on QNAP

Post by pdupreez »

I have read through the whole topic, but have not managed to find a solution. I am trying to get NEWZNAB running on a TVS-EC1080+. I have the web portion of NEWZNAB running, but when trying to update using /mnt/ext/opt/apache/bin/php -c /php.ini update_releases.php I get errors

Code: Select all

Failed loading opcache.so:  opcache.so: cannot open shared object file: No such file or directory
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/imagick.so' - /usr/local/apache/modules/php5.5/imagick.so: undefined symbol: zend_new_interned_string in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/zlib.so' - /usr/local/apache/modules/php5.5/zlib.so: undefined symbol: php_output_handler_create_internal in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/curl.so' - /usr/local/apache/modules/php5.5/curl.so: undefined symbol: php_output_write in Unknown on line 0
PHP Warning:  PHP Startup: calendar: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/iconv.so' - /usr/local/apache/modules/php5.5/iconv.so: undefined symbol: php_output_handler_alias_register in Unknown on line 0
PHP Warning:  PHP Startup: gd: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/session.so' - /usr/local/apache/modules/php5.5/session.so: undefined symbol: append_user_shutdown_function in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/pdo.so' - /usr/local/apache/modules/php5.5/pdo.so: undefined symbol: zend_new_interned_string in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/sqlite.so' - /usr/local/apache/modules/php5.5/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/local/apache/modules/php5.5/sqlite3.so' - /usr/local/apache/modules/php5.5/sqlite3.so: undefined symbol: zend_new_interned_string in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/pdo_mysql.so' - /usr/local/apache/modules/php5.5/pdo_mysql.so: undefined symbol: mysqlnd_get_client_info in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/pdo_sqlite.so' - /usr/local/apache/modules/php5.5/pdo_sqlite.so: undefined symbol: php_pdo_unregister_driver in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/mysql.so' - /usr/local/apache/modules/php5.5/mysql.so: undefined symbol: _mysqlnd_init in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/mysqli.so' - /usr/local/apache/modules/php5.5/mysqli.so: undefined symbol: mysqlnd_get_client_info in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/openssl.so' - /usr/local/apache/modules/php5.5/openssl.so: undefined symbol: _php_stream_fill_read_buffer in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/zip.so' - /usr/local/apache/modules/php5.5/zip.so: undefined symbol: zend_new_interned_string in Unknown on line 0
PHP Warning:  PHP Startup: bcmath: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: dba: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/exif.so' - /usr/local/apache/modules/php5.5/exif.so: undefined symbol: zend_multibyte_fetch_encoding in Unknown on line 0
PHP Warning:  PHP Startup: ftp: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: gettext: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: imap: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: ldap: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/mbstring.so' - /usr/local/apache/modules/php5.5/mbstring.so: undefined symbol: zend_multibyte_set_internal_encoding in Unknown on line 0
PHP Warning:  PHP Startup: mysqlnd: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: pcntl: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: shmop: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/soap.so' - /usr/local/apache/modules/php5.5/soap.so: undefined symbol: zend_new_interned_string in Unknown on line 0
PHP Warning:  PHP Startup: sockets: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/wddx.so' - /usr/local/apache/modules/php5.5/wddx.so: undefined symbol: zend_unmangle_property_name_ex in Unknown on line 0
PHP Warning:  PHP Startup: xmlrpc: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/apache/modules/php5.5/xsl.so' - /usr/local/apache/modules/php5.5/xsl.so: undefined symbol: zend_new_interned_string in Unknown on line 0
Could not open input file: update_releases.php/mnt/ext/opt/apache/bin/php
I have no idea where to start to fix that.

I tried running the scripts from [/share/Web/newznab/misc/update_scripts] using php update_releases.php

and I then get the following error:

Code: Select all

PHP Fatal error:  Class 'PDO' not found in /share/CACHEDEV1_DATA/Web/newznab/www/config.php on line 14
At this point I am stuck, and do not know the way forward and would appreciate your assistance
TS-809 Pro, 8 x 3Tb
TVS-EC1080 Pro, 10 x 10Tb Seagate, 32Gb Ram, 512Gb mSATA
DroboPro, 8 x 3Tb
User avatar
forkless
Experience counts
Posts: 1907
Joined: Mon Nov 23, 2009 6:52 am
Location: The Netherlands

Re: Installing Newznab on QNAP

Post by forkless »

Can you try to call the php command without the -c /php.ini option.
dehli
Starting out
Posts: 35
Joined: Mon Mar 23, 2015 12:42 am

Re: Installing Newznab on QNAP

Post by dehli »

My T-453 Pro recently crashed, and I switched to Entware when rebuilding it. I'm back to installing Newznab, which I've had running for years without issue on my NAS.

My problem is that there is no php-pear package in Entware, and I'm not sure how I get it integrated.

Is anyone else using Entware and successfully running Newznab?

I've posted this question below, as early as January with no replies:

http://forum.qnap.com/viewtopic.php?f=3 ... 47#p551647

Any help would be appreciated.

Thanks,
Thomas
User avatar
forkless
Experience counts
Posts: 1907
Joined: Mon Nov 23, 2009 6:52 am
Location: The Netherlands

Re: Installing Newznab on QNAP

Post by forkless »

If you have enough memory on your 453 Pro I would suggest switching to a virtual machine running Ubuntu or something similar, far less headaches.
tranzy
Starting out
Posts: 24
Joined: Sat Apr 25, 2009 3:14 am

Re: Installing Newznab on QNAP

Post by tranzy »

Having the same issue!

Rather have (in my case) Spotweb running directly on the NAS the have it in a VM.
User avatar
r6ual
New here
Posts: 9
Joined: Mon May 16, 2011 1:54 pm

Re: Installing Newznab on QNAP

Post by r6ual »

dehli wrote: My problem is that there is no php-pear package in Entware, and I'm not sure how I get it integrated.

Is anyone else using Entware and successfully running Newznab?

I've posted this question below, as early as January with no replies:

http://forum.qnap.com/viewtopic.php?f=3 ... 47#p551647

Any help would be appreciated.

Thanks,
Thomas
EXACT same issue here too.. php-pear is the only thing thats failing the pre-req tests..

When I use the Qapache httpd webserver, newznab pre-req tests complains of no mysql support , and dont know how to get around that issue either :-)
TS-421 && TVS-871
mupet0000
Starting out
Posts: 12
Joined: Mon Jan 25, 2016 3:29 am

Re: Installing Newznab on QNAP

Post by mupet0000 »

I wonder if anyone can help. I have installed Apache, phpmyadmin and newznab. Using the built in SQL. When starting newznab for the first time it goes through the preflight checklist and everything passes except one thing:

Checking for mysql_connect():
The PHP installation lacks support for MySQL(mysql_connect).

I am a novice and I can't seem to find any documentation about this. I probably need to configure something in phpmyadmin but I just don't know what.

I have restarted my NAS just to make sure, and everything is running.
Post Reply

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”