Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: MrToga on April 14, 2022, 06:22:09 AM

Title: LAMP environment
Post by: MrToga on April 14, 2022, 06:22:09 AM
Hello i'm a newbie on tiny linux and I'm triyng to create a lamp environment on my rpi 2 with piCore v13.x and i do not find the apache, mariadb and php extension on the repo.

Can someone help me please

Thanks in advance.
Title: Re: LAMP environment
Post by: Juanito on April 14, 2022, 08:35:01 AM
Those extensions do not exist in the repo - you would need to compile them.
Title: Re: LAMP environment
Post by: MrToga on April 15, 2022, 12:05:38 AM
Thank you for your response

How can i compile them (sorry i'm very new to linux) ?
Title: Re: LAMP environment
Post by: Juanito on April 15, 2022, 12:12:34 AM
If you look here: http://www.tinycorelinux.net/10.x/x86_64/tcz/src/php/

..there’s an example build script for php for x86_64 that could be adapted..
Title: Re: LAMP environment
Post by: MrToga on April 15, 2022, 12:50:40 AM
I read the build script(what I could)but were can i execute this? (I have installed gcc.tcz and compiletcz i don't know if this can be of any use)
Title: Re: LAMP environment
Post by: MrToga on April 15, 2022, 02:25:07 AM
I have compiled php-7.4.0.tar.xz(this package can be find on the link you sent me earlier) on piCore     but when i run the configure script, he don't find the libxml-2.0 package.
So i tried to install the lixml2.tcz in the repo and create a symbolic link with the libxml2.so into libxml-2.0.
But he still doesn't find the package.
Any tought?
Title: Re: LAMP environment
Post by: Juanito on April 15, 2022, 03:55:45 AM
You need to load the libxml2-dev extension.
Title: Re: LAMP environment
Post by: MrToga on April 15, 2022, 04:13:40 AM
It works ! thank you I also needed to load SQlite3-dev.tcz and now i was thinking if I import the apache2.4 extension from the piCore v9 into mine.

Is it possible or do i need to do the same thing as I did(if you have a link for the apache2.4 it would be nice).
Title: Re: LAMP environment
Post by: Rich on April 15, 2022, 04:23:59 AM
Hi MrToga
A build script for Apache can be found here:
http://tinycorelinux.net/8.x/armv7/tcz/src/apache2.4/
Title: Re: LAMP environment
Post by: MrToga on April 15, 2022, 06:22:59 AM
Thanks.
But is it ok if i use this extension for piCore v8 on my piCore v13.x?
Title: Re: LAMP environment
Post by: MrToga on April 15, 2022, 07:46:18 AM
I tried to compile apache with the link you send but when i ./configure i get an error that i don't have APR-util so i tried to install APR-util with the same link you send me.
But now when I ./configure the directory apr-util i have an error that said APR could not be located. Please use the --with-apr option but when i use the --with-apr piCore don't find any .shell.  Am I missing a file?
Title: Re: LAMP environment
Post by: patrikg on April 15, 2022, 08:22:10 AM
Do you need apache ?
I think it easier to make/compile a nginx extension.
And with PHP-FPM.
Title: Re: LAMP environment
Post by: Rich on April 15, 2022, 08:49:09 AM
Hi MrToga
... get an error that i don't have APR-util so i tried to install APR-util with the same link you send me. ...
No, install  apr-util-dev.tcz  from TC13:
Code: [Select]
tce-load -wi apr-util-dev.tcz
Title: Re: LAMP environment
Post by: MrToga on April 19, 2022, 01:32:28 AM
Hello guys and thank for the help so far.

So when ./configure it worked fine but after reading the INSTALL file then told us to use the command make after ./configure but i get this error :

/bin/sh: /usr/local/build-1/libtool : not found

So i checked if libtool is there and it is.

Any tought ?
Title: Re: LAMP environment
Post by: Juanito on April 19, 2022, 02:51:53 AM
I’d guess you are missing perl5, python or bash.
Title: Re: LAMP environment
Post by: MrToga on April 19, 2022, 02:55:44 AM
Yes I was missing bash.

Thanks
Title: Re: LAMP environment
Post by: MrToga on April 19, 2022, 03:02:26 AM
I get another error in my make command that said :

/bin/sh: can't open '/home/tc/apacheBuild/httpd-2.4.20/shlibtool' : No such file or directory.

Am I missing another extension ?
Title: Re: LAMP environment
Post by: MrToga on April 19, 2022, 03:57:57 AM
OK I just needed to ./configure and then make
Title: Re: LAMP environment
Post by: MrToga on April 19, 2022, 07:19:01 AM
How can i create a extention .tcz with apache.I saw a video on how to create a extension (link : https://www.youtube.com/watch?v=yRm-YRuLFio) but my question is how do I keep all my compiled apache because with the command make install apache's file are everywhere. Do I need to move all the apache files into one directory ?
Title: Re: LAMP environment
Post by: Rich on April 19, 2022, 07:40:35 AM
Hi MrToga
The  ,build  script found here handles ./configure, compiling, and packaging for you:
http://tinycorelinux.net/8.x/armv7/tcz/src/apache2.4/

Download these files from the link:
Code: [Select]
apache2.4.build                                    08-Jul-2016 14:02                4656
apache2.4.ins                                      31-May-2016 06:36                 492
httpd-2.4.20.tar.gz                                02-May-2016 02:38             8299011
httpd-2.4.23.tar.bz2                               06-Jul-2016 08:11             6351875
httpd.conf                                         19-Oct-2015 02:00               18552
The script is currently set up to compile version  2.4.23.  Edit the script and change that to  2.4.20 (2 places)
if you want the older version for some reason.

Make the following 2 scripts executable:
Code: [Select]
chmod 775 apache2.4.build
chmod 775 apache2.4.ins

This line in the  .build  script tells  make  where to install the files so they are not scattered all over the place:
Code: [Select]
make install DESTDIR=$TMPDIR
Title: Re: LAMP environment
Post by: MrToga on April 20, 2022, 01:58:32 AM
Hi it worked thank you.

So now I was wondering since I've got apache2.4.tcz if i could put this file in my /mnt/mmcblk0p2/tce/optimal directory but I saw a <extension name>.tcz.dep and i don't have it,
It is okay or do i really need this extension to make apache permanent on my rasp.
Title: Re: LAMP environment
Post by: MrToga on April 20, 2022, 03:57:38 AM
OK so I run the script i put  apache2.4.tcz (also apache2.4-dev.tcz and apache2.4-doc.tcz) in /mnt/mmcblk0p2/tce/oprimal and in the onboot.lst file but I don't find the file that run my apache server.

Any tought ?
Title: Re: LAMP environment
Post by: MrToga on April 20, 2022, 05:17:57 AM
update :

I found that in the script there are 2 line in the .build that are commented in the section service script :
#mkdir -p $TMPDIR/usr/local/etc/init.d
#cp apache2.4.srv $TMPDIR/usr/local/etc/init.d/apache2.4
 
So i tried to uncomment them and run the script but I don't find the etc repertory in /tmp/tcloop/apache2.4/usr/local/ .
Am I searching in the wrong area?
Title: Re: LAMP environment
Post by: Rich on April 20, 2022, 06:00:05 AM
Hi MrToga
I found that in the script there are 2 line in the .build that are commented in the section service script : ...
You can comment those lines out again.
The file it refers to is a systemd service script and does not exist. Tinycore does not use systemd.

... I saw a <extension name>.tcz.dep and i don't have it, ...
That is the dependency file for apache. It is used by the operating system to load other extensions Apache needs
in order to run.
Place this file in your  /mnt/mmcblk0p2/tce/optional  directory.
http://tinycorelinux.net/8.x/armv7/tcz/apache2.4.tcz.dep

Run this command:
Code: [Select]
tce-load -w apr-util openssl pcre
... (also apache2.4-dev.tcz and apache2.4-doc.tcz) in /mnt/mmcblk0p2/tce/oprimal and in the onboot.lst ...
You don't need those to run apache.

Reboot your RPi and then try starting apache as mentioned here:
http://tinycorelinux.net/8.x/armv7/tcz/apache2.4.tcz.info
Title: Re: LAMP environment
Post by: MrToga on April 20, 2022, 06:38:58 AM
Hi Rich,

After I've done what you told me I try to use the .info and saw the command to start apache but when I try the command I get this error :
sudo apachectl -k start
sudo: apachectl: command not found
Title: Re: LAMP environment
Post by: Rich on April 20, 2022, 06:46:58 AM
Hi MrToga
Does this command find apachectl:
Code: [Select]
ls -l /usr/local/sbin/apachectl
Also, the build script should have created  apache2.4.tcz.list.  Please attach a copy of that to your next post.
Title: Re: LAMP environment
Post by: MrToga on April 20, 2022, 06:53:04 AM
ls -l /usr/local/sbin/apachectl don't find apachectl
And in the apache2.4.tcz.list I don't find apachectl neither
Title: Re: LAMP environment
Post by: Rich on April 20, 2022, 07:05:16 AM
Hi MrToga
Somewhere an error occurred and and nothing was built. This is what that file should look like:
http://tinycorelinux.net/8.x/armv7/tcz/apache2.4.tcz.list

Run this:
Code: [Select]
ls -l /usr/local/tce.installed > installed.txt
Attach  installed.txt  to your next post.
Title: Re: LAMP environment
Post by: MrToga on April 20, 2022, 07:09:51 AM
Here
Title: Re: LAMP environment
Post by: Rich on April 20, 2022, 07:20:04 AM
Hi MrToga
I suspect some  -dev  extensions may be missing, possibly  openssl.  Look in the build directory for a  .log  file.
It's probably called  config.log.  Attach that to your next post.
Title: Re: LAMP environment
Post by: MrToga on April 20, 2022, 07:26:24 AM
I think I was missing the openssl-dev because after installing it i tried a ./apache2.4.build and it seem longer than the last attempts with the .build
I will tell you after it's finished
Title: Re: LAMP environment
Post by: Rich on April 20, 2022, 07:35:01 AM
Hi MrToga
Hopefully that's the last piece of the puzzle. :)
Title: Re: LAMP environment
Post by: MrToga on April 20, 2022, 07:45:20 AM
Ok so it's finished but I still miss something.
Because my apache2.4.tcz.list looks like this now
Title: Re: LAMP environment
Post by: Rich on April 20, 2022, 08:04:35 AM
Hi MrToga
I suspect a compilation error, maybe a missing  .h  file. Lets see if running the build script like this catches the error:
Code: [Select]
./apache2.4.build > build.txt 2>&1
Attach  build.txt  to your next post.
Title: Re: LAMP environment
Post by: MrToga on April 21, 2022, 12:30:03 AM
Hi
Here's the build.txt (was too big for the website so it's compressed)
Title: Re: LAMP environment
Post by: MrToga on April 21, 2022, 04:51:25 AM
I found something while doing the compilation of apache manually I get a few error that said :

ab.c:(.text.startup+0x80c): undefined reference to `SSLv2_client_method'
/usr/local/bin/ld: ab.c:(.text.startup+0x8b8): undefined reference to `CRYPTO_malloc_init'
collect2: error: ld returned 1 exit status

And this are the same errors as in the file build.txt.
It's strange because i've done the compilaiton manually earlier and it worked.
How can I correct that?
Title: Re: LAMP environment
Post by: Rich on April 21, 2022, 07:22:19 AM
Hi MrToga
After some searching it appears the issue is openssl changed:
Quote
----- Snip -----
OpenSSL 1.0.2 and earlier provided CRYPTO_malloc_init:
 ----- Snip -----
OpenSSL 1.1.0 and later do not appear to provide CRYPTO_malloc_init:
 ----- Snip -----
Found here:
https://stackoverflow.com/a/40606758

openssl changed from  1.0.2j:
http://tinycorelinux.net/8.x/armv7/tcz/openssl.tcz.info
to  1.1.1l:
http://tinycorelinux.net/13.x/armv7/tcz/openssl.tcz.info

I would say you should try a newer source package. andyj maintains apache for the x86 repositories and he is
currently using version  2.4.46. I would follow his lead. The apache source packages can be found here:
http://archive.apache.org/dist/httpd/
I suggest downloading this:
http://archive.apache.org/dist/httpd/httpd-2.4.46.tar.bz2

The script is currently set up to compile version  2.4.23.  Edit the script and change that to  2.4.46 (2 places)

Make sure  the following extensions are installed:
apr-util-dev expat2-dev gdbm-dev openssl-dev pcre-dev

Try running the build script and see what pops up.
Title: Re: LAMP environment
Post by: MrToga on April 21, 2022, 07:48:58 AM
Hi Rich,
So after using the script my apache2.4.tcz.list look like this but now the script doesn't create the apache2.4.tcz
Title: Re: LAMP environment
Post by: Rich on April 21, 2022, 07:56:55 AM
Hi MrToga
At first glance, that appears to be a successful build. Do you have  squashfs-tools  installed?
Title: Re: LAMP environment
Post by: MrToga on April 21, 2022, 08:06:02 AM
Yes it's already install but the error is :

mv : can' rename '../apache2.4.tcz/usr/local/lib/*.a' : No such file or directory
mv : can' rename '../apache2.4.tcz/usr/local/lib/*.ala : No such file or directory
mv : can' rename '../apache2.4.tcz/usr/local/lib/*.exp' : No such file or directory
mv : can' rename '../apache2.4.tcz/usr/local/lib/pkgconfig' : No such file or directory
mksquashfs: error while loading shared libraries: liblzo2.so.2: cannot open shared object file: no such file or directory
mv : can't rename '../apache2.4.tcz' : No such file or directory
md5sum : can't open '../apache2.4.tcz' : No such file or directory

same error goes for apache2.4.dev and .doc

Sorry I need to go have a nice day Rich and thanks for the help so far :)
Title: Re: LAMP environment
Post by: Rich on April 21, 2022, 08:14:40 AM
Hi MrToga
... mksquashfs: error while loading shared libraries: liblzo2.so.2: cannot open shared object file: no such file or directory ...
lzo.tcz  is a dependency of  squashfs-tools.tcz  and should have been loaded with  squashfs-tools:
http://tinycorelinux.net/13.x/armv7/tcz/squashfs-tools.tcz.dep

Do you have a  squashfs-tools.tcz.dep  in your  tce/optional  directory whose contents match the above link?
Title: Re: LAMP environment
Post by: MrToga on April 22, 2022, 12:17:19 AM
Hi Rich,

My squashfs-tools.tcz.dep have the same content than in the link
Title: Re: LAMP environment
Post by: MrToga on April 22, 2022, 01:01:35 AM
Update :

It work I think I didn't install squashfs-tools.tcz but now apache is working and it's persistent.

Title: Re: LAMP environment
Post by: Rich on April 22, 2022, 05:44:37 AM
Hi MrToga
So, are you saying the build script now completes correctly and creates the  apache2.4.tcz  file?
Title: Re: LAMP environment
Post by: MrToga on April 22, 2022, 05:53:15 AM
Hi Rich,

Yes i've got apache2.4.tcz an it's persistent on my rasp
Title: Re: LAMP environment
Post by: MrToga on April 25, 2022, 02:57:33 AM
Hello everyone,

I'm triyng to make php persistent on my rasp.
After I have configure and compile php I have Install php in a folder I have created just for this and now i was wondering if anyone know what folder and wich file to compress with squashfs-tools to have a php7.tcz php7-dev.tcz and php7-doc.tcz
I'am using this version of php http://tinycorelinux.net/8.x/armv7/tcz/src/php7/
Title: Re: LAMP environment
Post by: MrToga on April 25, 2022, 06:54:32 AM
Update :
 Juanito link a script to build php for x86_64 and I was wondering how can i adapt this script fo piCore or is there an existing php script for piCore ?
(link : http://www.tinycorelinux.net/10.x/x86_64/tcz/src/php/build-php.sh)
Thanks in advance.
Title: Re: LAMP environment
Post by: Rich on April 25, 2022, 07:04:23 AM
Hi MrToga
Looking at what andyj did for TC8 x86_64:
Code: [Select]
----- Snip -----
EXT=php7
TCZ=/tmp/$EXT/TCZ
 ----- Snip -----
make
 ----- Snip -----
make install INSTALL_ROOT=$TCZ-dev
 ----- Snip -----
He tells the make process where to install the results.
After that, he proceeds to remove what does not belong in  -dev  into other extensions.
Found here:
http://www.tinycorelinux.net/8.x/x86_64/tcz/src/php7/build-php.sh

That build script is x86_64 specific so I would not try to run it directly.
Try adding this after  make -j4  in your build script:
Code: [Select]
EXT=php7
TCZ=/tmp/$EXT/TCZ
make install INSTALL_ROOT=$TCZ-dev
If that works, you can try copying everything after  make install INSTALL_ROOT=$TCZ-dev  from andyj script.
Title: Re: LAMP environment
Post by: MrToga on April 25, 2022, 07:21:08 AM
Hi Rich

I found a php.config script (here :http://www.tinycorelinux.net/8.x/armv7/tcz/src/php7/php7.config) but when I run it I get this error
It said that I don't have apxs but I already have the apx command but I don't know where to find it.
Title: Re: LAMP environment
Post by: Rich on April 25, 2022, 07:32:38 AM
Hi MrToga
According to this,  apxs  should be in the apache extension you built:
http://tinycorelinux.net/8.x/armv7/tcz/apache2.4.tcz.list

Also, is  perl5.tcz  loaded?
Title: Re: LAMP environment
Post by: MrToga on April 25, 2022, 07:37:19 AM
Yes perl5.tcz is loaded and I have apxs
Title: Re: LAMP environment
Post by: MrToga on April 25, 2022, 07:39:34 AM
I think apxs is in another folder than /usr/local/bin because in this folder i don't find apachectl neither wich work
Title: Re: LAMP environment
Post by: MrToga on April 25, 2022, 07:47:22 AM
Nevermind I found apxs it in the usr/local/bin folder
Title: Re: LAMP environment
Post by: Rich on April 25, 2022, 07:47:48 AM
Hi MrToga
I think apxs is in another folder than /usr/local/bin ...
If it's present, this will tell you where it is:
Code: [Select]
which apxs
Title: Re: LAMP environment
Post by: MrToga on April 26, 2022, 12:27:36 AM
Hi Rich,

I found it using which apxs and it return :

/usr/local/bin/apxs
Title: Re: LAMP environment
Post by: MrToga on April 26, 2022, 01:42:29 AM
Update :

I found the error (here : https://stackoverflow.com/questions/43640200/there-is-a-error-as-apxs-not-found-and-apache-is-not-built-when-i-buildconfigur), I needed to add a line in the apache build script (link : http://tinycorelinux.net/8.x/armv7/tcz/src/apache2.4/apache2.4.build) in
./configure \
--with-apxs
Title: Re: LAMP environment
Post by: MrToga on April 26, 2022, 06:15:01 AM
Hello guys,

I finally have php7 persistent but I tried to run php code on my apache server but apache doesn't interpret php
How can I fix that?
Title: Re: LAMP environment
Post by: Rich on April 26, 2022, 07:06:26 AM
Hi MrToga
I know nothing about Apache or PHP, but I do know this, secrecy is not a good strategy when seeking assistance. You
are literally our eyes since we can not see your screen so we don't know what you've tried or what kind of errors
may have been displayed.

Possible information to provide may include but is not limited to:
Post your php code.
Tell us where you placed the file containing that code.
Changes you made to http.conf.
Changes you made to php.ini.
Changes you made to any other  .conf/.ini  files.
Error messages you received.

This is the  .info  file for an old php5 extension. It has some notes on apache that might be useful:
http://tinycorelinux.net/10.x/x86/tcz/php5.tcz.info
Title: Re: LAMP environment
Post by: MrToga on April 26, 2022, 07:28:22 AM
Hi Rich,

I tried to do a make install INSTALL_ROOT=/tmp/php7 and now i'm searching in this repertory and I don't find php.ini nor libphp5.so needed for interpretation.
(link here :https://www.php.net/manual/fr/install.unix.apache2.php)
I also used this script to compile.
Title: Re: LAMP environment
Post by: Rich on April 26, 2022, 09:43:54 AM
Hi MrToga
See if the attached file runs without errors.
If it does, attach the  php7.list  file to your next post.
If it doesn't, post the errors.
Title: Re: LAMP environment
Post by: MrToga on April 27, 2022, 05:14:31 AM
Hi Rich,

After I run php7.config I get an error that libmcrypt was not found so I compiled the extension using this link ( http://www.tinycorelinux.net/8.x/armv7/tcz/src/libmcrypt/)
and then I get some error from openssl using php7.config  so I put the result in build.txt .
Title: Re: LAMP environment
Post by: Rich on April 27, 2022, 01:50:56 PM
Hi MrToga
... I get an error that libmcrypt was not found so I ...
Copy  libmcrypt.tcz , libmcrypt-dev.tcz , and  libmcrypt-dev.tcz.dep  from:
http://tinycorelinux.net/8.x/armv7/tcz/

Then:
Code: [Select]
tce-load -i libmcrypt-dev
This is the same version being used in the TC13 x86 and x86_64 repositories.
Title: Re: LAMP environment
Post by: MrToga on April 28, 2022, 04:59:53 AM
Hi,
After I have dowloaded libmcrypt.tcz libmcrypt-dev.tcz and libmcrypt-dev.tcz.dep and add it in /mnt/mmblk0p2/tce/optional directory I tried to use the php7.config script but I get a bunch of error from openssl.c.
Here is the php7.config script and the build.txt (the return of the sript).

Any thougths ?
Title: Re: LAMP environment
Post by: Juanito on April 28, 2022, 05:29:49 AM
Did you load the libmcrypt-dev extension?
Title: Re: LAMP environment
Post by: MrToga on April 28, 2022, 05:33:47 AM
Hi juanito,

Yes libmcrypt-dev is loaded
Title: Re: LAMP environment
Post by: Juanito on April 28, 2022, 05:54:48 AM
You could try loading coreutils to remove some of the errors.

Which version of openssl are you using - it looks like php is looking for a newer version?
Title: Re: LAMP environment
Post by: MrToga on April 28, 2022, 05:56:03 AM
I'm currently using openssl 1.1.1
Title: Re: LAMP environment
Post by: MrToga on April 28, 2022, 06:22:26 AM
Hi,

After searching I found out that in the ./configure help openssl need to be in version 0.9.8 but the problem is that I need this version of openssl for my apache

Here the file from ./configure --help
Title: Re: LAMP environment
Post by: Juanito on April 28, 2022, 07:03:40 AM
Which version of php are you trying to compile - the versions in the x86_64 repo use openssl-1.1.1
Title: Re: LAMP environment
Post by: Rich on April 28, 2022, 07:05:15 AM
Hi MrToga
After I have dowloaded libmcrypt.tcz libmcrypt-dev.tcz and libmcrypt-dev.tcz.dep ...
I believe the  build.txt  you attached (reply #62) is the same file you attached to reply #60 and not a fresh file.

The new  php7.config file  shows you removed  --enable-so  option but the  build.txt  file you posted still contains this:
Code: [Select]
configure: WARNING: unrecognized options: --enable-so
I also ran a  diff  on the 2  build.txt  files and they are identical.


... openssl need to be in version 0.9.8 ...
No, it says:
Code: [Select]
  --with-openssl=DIR      Include OpenSSL support (requires OpenSSL >= 0.9.8)That means  0.9.8  is the minimum version, so  1.1.1  is fine.
Title: Re: LAMP environment
Post by: MrToga on April 28, 2022, 07:24:29 AM
Hi,
I'm compiling the php version of raspberry PI (here : http://www.tinycorelinux.net/8.x/armv7/tcz/src/php7/ ) and also I repost the same file because after compiling php7 I'll still have the same error than the last one sorry if it's disturb you .
But I found something in the build file:
Code: [Select]
/home/tc/php-7.0.8/ext/openssl/openssl.c:1923:15: error: invalid use of incomplete typedef 'X509_EXTENSION' {aka 'struct X509_extension_st'}
 1923 |  p = extension->value->data;
So with this I search in /usr/local/include/openssl/ossl_typ.h to see if the funxtion x509 is here.
Title: Re: LAMP environment
Post by: Juanito on April 28, 2022, 08:09:07 AM
php-7.4.14 builds on an RPi3 against openssl-1.1.1 and apache-2.4.46..
Title: Re: LAMP environment
Post by: Rich on April 28, 2022, 08:12:08 AM
Hi MrToga
Try changing this:
Code: [Select]
--with-openssl \To this:
Code: [Select]
--with-openssl-dir=/usr/local \
--with-openssl=shared,/usr/local \
in your  php7.config  file.

Also make sure  openssl-dev  is loaded.
Title: Re: LAMP environment
Post by: MrToga on April 29, 2022, 02:46:19 AM
Hello guys,

After I wrote the commands Rich said I still have the same error, and I also tried a new version of php (php7.4.29.tar.xbz link:https: //www.php.net/downloads ) but in this new version he doesn't fin oniguruma during the comilation.
Here is the build.txt from the php7.0
Title: Re: LAMP environment
Post by: Juanito on April 29, 2022, 02:53:28 AM
I think you will need to build libonig and use php-7.4.14 - this is what I did on piCore-13.1 and it worked.
Title: Re: LAMP environment
Post by: MrToga on April 29, 2022, 02:59:31 AM
Hi juanito,

Where can I foud php 7.4.14 and libonig ?
Title: Re: LAMP environment
Post by: Juanito on April 29, 2022, 03:01:58 AM
I compiled it from source: http://tinycorelinux.net/12.x/x86_64/tcz/src/php/
Title: Re: LAMP environment
Post by: Juanito on April 29, 2022, 03:03:29 AM
..and onig-6.9.6 from here:  http://tinycorelinux.net/11.x/x86_64/tcz/src/libonig/
Title: Re: LAMP environment
Post by: MrToga on April 29, 2022, 04:41:10 AM
Hi juanito,

After compiling onig I tried to compil php7.4.14 with the same php7.config script but during the make I got this error /usr/local/include/ap_hooks.h:40:10: fatal error: apr_hooks.h: no such file or directory
But I found this file in /tmp/tcloop/apr-util-dev/usr/local/include/apr-1/apr_hooks.h
Any tought ?
Title: Re: LAMP environment
Post by: MrToga on April 29, 2022, 04:54:24 AM
Update : I didn't set apr-util onboot
Now i Find the file in the correct directory
Title: Re: LAMP environment
Post by: MrToga on April 29, 2022, 06:24:42 AM
Hi,

After I succefully compiled php-7.4.14 with php7.config I still can't interpret php on my apache server and I also have in /usr/local/apache2/modules/ my files named libphp7.so for the interpretion but still can't interpret.
I used this link for help : ( https://www.php.net/manual/fr/install.unix.apache2.php )
Any toughts?
Title: Re: LAMP environment
Post by: Juanito on April 29, 2022, 06:27:20 AM
Do you get an error message?
Title: Re: LAMP environment
Post by: MrToga on April 29, 2022, 06:27:52 AM
Not at all

Just for the make install INSTALL_ROOT= so I just comment them on the script
Title: Re: LAMP environment
Post by: eSPee on April 29, 2022, 06:42:10 AM
Hi MrToga,

A few days ago i more or less ran into the same challenges that you face with missing apache extension for 13.x.
After some tinkering i decided to move back to a 9.x version of piCore. That version does have apache, php & maria and you can install them from the app in the desktop enviroment. They now run fine on my ZeroW ;)

Maybe this is a solution four you as well, good luck  ;)
Title: Re: LAMP environment
Post by: Juanito on April 29, 2022, 06:54:45 AM
I also have in /usr/local/apache2/modules/ my files named libphp7.so for the interpretion but still can't interpret.

Does this give an error:
Code: [Select]
ldd /usr/local/apache2/modules/libphp7.so
Title: Re: LAMP environment
Post by: MrToga on April 29, 2022, 07:00:29 AM
Hi,

After I run your command i've got this but it doesn't return an error
Title: Re: LAMP environment
Post by: MrToga on April 29, 2022, 07:02:09 AM
Hi eSPee,

I don't want to go on a lower version of piCore because I really need firefox and in the piCore9.x it doesn't exist
Title: Re: LAMP environment
Post by: Juanito on April 29, 2022, 08:18:39 AM
After I run your command i've got this but it doesn't return an error

That looks OK.

I know nothing about apache/php, so it's difficult to troubleshoot. I would guess that there is a way to start apache that gives verbose error messages, which might help.

You could also compare your build files to those in the 9.x repo (*.tcz.list) to see if you are missing something.
Title: Re: LAMP environment
Post by: MrToga on May 02, 2022, 05:01:59 AM
Update :

It worked !
I just needed to add in the httpd.conf files this command :
Code: [Select]
<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>
Title: Re: LAMP environment
Post by: MrToga on May 02, 2022, 05:39:35 AM
Hi,

Now I was wondering if it exist a script to make onig persistent because I didn't find any script nor any make install INSTALL_ROOT= for onig
I'm using this version of onig : http://tinycorelinux.net/11.x/x86_64/tcz/src/libonig/
Title: Re: LAMP environment
Post by: Juanito on May 02, 2022, 06:00:28 AM
see attached
Title: Re: LAMP environment
Post by: MrToga on May 02, 2022, 06:07:16 AM
Thanks juanito,

But in the file you attached are you sure you can remove files by doing this
Code: [Select]
vi files [remove those that do not belong]
Why don't we use rm here ?
Title: Re: LAMP environment
Post by: Juanito on May 02, 2022, 06:09:08 AM
The file named "files" contains a list of files created after the timestamp "mymarker", you need to edit the list to remove the files that are not required.
Title: Re: LAMP environment
Post by: MrToga on May 02, 2022, 06:11:47 AM
Do I need to do it manually or it's in the next command ?
Title: Re: LAMP environment
Post by: MrToga on May 02, 2022, 06:14:06 AM
Ok so i need to remove all the files that doesn't belong to the extension
Am I right?
Title: Re: LAMP environment
Post by: Juanito on May 02, 2022, 06:16:30 AM
affirmative - if you are going to submit an extension, you need to make libonig and libonig-dev
Title: Re: LAMP environment
Post by: MrToga on May 02, 2022, 06:18:05 AM
what files are needed for an extension-dev and an extension
Because I don't see the difference between them
Title: Re: LAMP environment
Post by: Rich on May 02, 2022, 06:20:12 AM
Hi MrToga
Code: [Select]
vi files [remove those that do not belong]vi  is the name of an editor that can be used from the command line. I prefer a GUI based editor myself.
files  is the name of a file that contains a list of file names. files.txt or files.list would have been more obvious.
You need to manually remove any file names from that list that don't belong to the extension.
Title: Re: LAMP environment
Post by: MrToga on May 02, 2022, 06:25:35 AM
Ok so my fault but I found out you can use make install DESTDIR=$PATH for onig and i get this tree :
onig/
usr/
local/
bin/                  include/                             lib/
Onig-config       oniggnu.h oniguruma.h       (.a .so .la and pkgconfig directory)


What I need to put in my onig-dev and my onig ?
Title: Re: LAMP environment
Post by: Rich on May 02, 2022, 06:35:10 AM
Hi MrToga
Congratulations on finding  DESTDIR=$PATH.  You just made your life easier.
The following belong in  -dev:
usr/local/bin/onig-config
usr/local/include/*
usr/local/lib/*.a
usr/local/lib/*.la
usr/local/lib/pkconfig/*

Something like this:
http://tinycorelinux.net/10.x/x86/tcz/libonig-dev.tcz.list
Title: Re: LAMP environment
Post by: MrToga on May 03, 2022, 02:57:18 AM
Hi,

I'm trying to install mariadb with this version (http://www.tinycorelinux.net/8.x/armv6/tcz/src/mariadb/ ) and now I'm trying to compile it but when I do the
Code: [Select]
cmake .
I get an error (Attached file) that said that I don't have CURSE so i tried to install ncurse-dev (link : http://tinycorelinux.net/13.x/armv6/tcz/) on my rpi but still have the same error.

Any toughts ?
Title: Re: LAMP environment
Post by: Juanito on May 03, 2022, 03:16:05 AM
Earlier versions of cmake had a lot of problems detecting ncurses.

You can check if you have ncurses and ncurses-dev loaded with:
Code: [Select]
tce-status -i | grep ncurses
If you run the command "cmake -LAH --blah --blah" it will output a list of configure switches - perhaps one of them might allow you to tell cmake where the ncurses headers and libraries are?
Title: Re: LAMP environment
Post by: Juanito on May 03, 2022, 03:29:55 AM
Try this:
Code: [Select]
-DCURSES_CURSES_LIBRARY=/usr/local/lib/libncurses.so -DCURSES_FORM_LIBRARY=/usr/local/lib/libform.so -DCURSES_INCLUDE_PATH=/usr/local/include -DCURSES_NCURSES_LIBRARY=/usr/local/lib/libncurses.so
Title: Re: LAMP environment
Post by: MrToga on May 03, 2022, 04:00:08 AM
Hi juanito,

After I run this command
Quote
-DCURSES_CURSES_LIBRARY=/usr/local/lib/libncurses.so -DCURSES_FORM_LIBRARY=/usr/local/lib/libform.so -DCURSES_INCLUDE_PATH=/usr/local/include -DCURSES_NCURSES_LIBRARY=/usr/local/lib/libncurses.so
It said that it didn't find libcurses.so
So I searched in /usr/local/lib to see if I have something with curses in it and i've got this :
libncurses++w.so
libncurses++w.so.6
libncurses++w.so.6.2
libncursesw.so
libncursesw.so.6
libncursesw.so.6.2
So I was wondering wich one should I used ?
Title: Re: LAMP environment
Post by: Juanito on May 03, 2022, 04:41:46 AM
Ah, sorry I was ssh'd into piCore, but looked on the local machine..

Try:
Code: [Select]
-DCURSES_CURSES_LIBRARY=/usr/local/lib/libncursesw.so -DCURSES_FORM_LIBRARY=/usr/local/lib/libformw.so -DCURSES_INCLUDE_PATH=/usr/local/include/ncursesw -DCURSES_NCURSES_LIBRARY=/usr/local/lib/libncursesw.so
Title: Re: LAMP environment
Post by: MrToga on May 03, 2022, 04:44:05 AM
Hi juanito,

I also tried this but still he can't found it
I get this error :
-sh: -DCURSES_CURSES_LIBRARY=/usr/local/lib/libncursesw.so: not found
Title: Re: LAMP environment
Post by: MrToga on May 03, 2022, 04:55:19 AM
Update :

I tried to run this :
Code: [Select]
sudo cmake \-DCURSES_CURSES_LIBRARY=/usr/local/lib/libncursesw.so \-DCURSES_FORM_LIBRARY=/usr/local/lib/libformw.so \-DCURSES_INCLUDE_PATH=/usr/local/include/ncursesw \-DCURSES_NCURSES_LIBRARY=/usr/local/lib/libncursesw.soAnd now I get this error :
Code: [Select]
Cmake Error at storage/xtradb/CMakeLists.txt:507 (MESSAGE):
Percona XtraDB is not supported on this plateform
Title: Re: LAMP environment
Post by: Juanito on May 03, 2022, 05:08:29 AM
I see there's a mention of that here: http://tinycorelinux.net/7.x/x86_64/tcz/src/mariadb/build-mariadb-10.1.sh
Title: Re: LAMP environment
Post by: MrToga on May 03, 2022, 05:38:01 AM
Any toughts on this one?
Title: Re: LAMP environment
Post by: MrToga on May 03, 2022, 05:49:46 AM
Update :

Strange thing appened I just reboot my rasp decompressed my mariadb run the previous command and now it work i'm currently doing my make
Title: Re: LAMP environment
Post by: MrToga on May 03, 2022, 05:56:51 AM
And now I get this error during the make
Title: Re: LAMP environment
Post by: Juanito on May 03, 2022, 06:04:33 AM
This looks like mariadb expects an older version of OpenSSL?

You could try a newer version of mariadb?
Title: Re: LAMP environment
Post by: MrToga on May 03, 2022, 06:05:47 AM
I could but I don't find any version for RPI (or I just don't know) here the link for the version :
 https://mariadb.com/downloads/
Title: Re: LAMP environment
Post by: Rich on May 03, 2022, 06:19:18 AM
Hi MrToga
There's a more recent version here:
http://tinycorelinux.net/12.x/x86_64/tcz/src/mariadb/
Title: Re: LAMP environment
Post by: MrToga on May 03, 2022, 06:39:38 AM
Hi guys,
The version Rich linked work but now I got this problem :
During the make I get an error that said I don't have space left on the device I'm currently compiling in /home/tc
The error : /usr/local/bin/Id: final link failed: no space left on device
Where can I compile this to get enough space ?
While using the command df | less I saw that I have 14.4G available on my /mnt/mmblk0p2 can I compile here or I am stuck?
Title: Re: LAMP environment
Post by: Rich on May 03, 2022, 06:46:58 AM
Hi MrToga
Yes. Make a directory on  /mnt/mmblk0p2  and build it there. The build may take longer, but you should not
run out of space.
Title: Re: LAMP environment
Post by: MrToga on May 03, 2022, 06:48:50 AM
Do I need to just put my mariadb directory in /mnt/mmblk0p2 ?
Title: Re: LAMP environment
Post by: Rich on May 03, 2022, 06:54:58 AM
Hi MrToga
That should be sufficient. What else did you think you might need?
Title: Re: LAMP environment
Post by: MrToga on May 03, 2022, 07:03:36 AM
Hi Rich,

I get another error :
Code: [Select]
/home/tc/mariadb-10.5.8/strings/ctype-cp932.c:34891:1: fatal error: error writing to /tmp/cc07N1G8.s : no space left on device
Maybe the make still compile in /home/tc ?
Title: Re: LAMP environment
Post by: Rich on May 03, 2022, 07:15:39 AM
Hi MrToga
After you created a source directory and unpacked the source package on  /mnt/mmblk0p2 , did you remove
it from  /tmp  to free up that space?

Also, any commands used for compiling that reference  /tmp  should be changed to point to  /mnt/mmblk0p2.
Title: Re: LAMP environment
Post by: MrToga on May 03, 2022, 07:24:10 AM
Hi Rich,

Yes I just put my mariadb repertory from /home/tc in /mnt/mmblk0p2 that's why I get another space error but now I decompressed my mariadb in /mnt/mmblk0p2 and do my
Code: [Select]
sudo cmake \-DCURSES_CURSES_LIBRARY=/usr/local/lib/libncursesw.so \-DCURSES_FORM_LIBRARY=/usr/local/lib/libformw.so \-DCURSES_INCLUDE_PATH=/usr/local/include/ncursesw \-DCURSES_NCURSES_LIBRARY=/usr/local/lib/libncursesw.so and when I do the sudo make I get another error because the make command try to download pcre2-10.34.zip from this link : http://ftp.pcre.org/pub/pcre/pcre2-10.34.zip
But can't get it and i get in return this error :
Code: [Select]
error: downloading 'http://ftp.pcre.org/pub/pcre/pcre2-10.34.zip' failed
status_code: 6
status_string: "Couldn't resolve host name"
log:
-- LOG BEGIN --
Could not resolve host: fpt.pcre.org
Closing connection 0

-- LOG END --
Title: Re: LAMP environment
Post by: Rich on May 03, 2022, 07:32:38 AM
Hi MrToga
Is  pcre2-dev.tcz  installed?

Also, this link that juanito posted provides some clues in the  cmake  section:
http://tinycorelinux.net/7.x/x86_64/tcz/src/mariadb/build-mariadb-10.1.sh

It includes the following:
Code: [Select]
-DWITH_PCRE=system
Title: Re: LAMP environment
Post by: MrToga on May 03, 2022, 07:49:13 AM
Hi Rich,

After running your command He still can't find pcre2-8
I get this error :
system pcre2-8 library is not found or unusable

But when I search pcre2-8 I found it in /usr/local/lib/libpcre2-8.so

I also tried to do
Code: [Select]
-DWITH_PCRE=/usr/local/lib/libpcre2-8.soBut he still try to download pcre2-10.34.zip
Title: Re: LAMP environment
Post by: Rich on May 03, 2022, 07:57:34 AM
Hi MrToga
If that's going to work, you might have to tell  it where, not what, like this:
Code: [Select]
-DWITH_PCRE=/usr/local/lib/
Title: Re: LAMP environment
Post by: Juanito on May 03, 2022, 08:51:06 AM
I don't think that will work:
Code: [Select]
// Which pcre to use (possible values are 'bundled', 'system', or 'auto')
WITH_PCRE:STRING=auto
Title: Re: LAMP environment
Post by: Rich on May 03, 2022, 11:31:01 AM
Hi Juanito
Well sure, if you're going to look at the source, of course you'll get it right.  :)
Title: Re: LAMP environment
Post by: Juanito on May 04, 2022, 01:50:04 AM
I updated cmake in case that was causing the problem - mariadb-10.5.8 configures for me:
Code: [Select]
cmake -LAH -DCMAKE_BUILD_TYPE=Release -DFEATURE_SET=xsmall -DMRN_GROONGA_EMBED=OFF -DWITH_SSL=system -DWITH_ZLIB=system -DWITH_PCRE=system -DWITH_READLINE=system -DWITH_EMBEDDED_SERVER=OFF -DMYSQL_MAINTAINER_MODE=OFF -DWITH_SYSTEMD=no -DMYSQL_DATADIR=/home/tc/mysql/data -DCMAKE_VERBOSE_MAKEFILE=TRUE -DCMAKE_CXX_FLAGS_RELEASE="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe -DNDEBUG" -DCMAKE_C_FLAGS_RELEASE="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe -DNDEBUG" -DCURSES_CURSES_LIBRARY=/usr/local/lib/libncursesw.so -DCURSES_FORM_LIBRARY=/usr/local/lib/libformw.so -DCURSES_INCLUDE_PATH=/usr/local/include -DCURSES_NCURSES_LIBRARY=/usr/local/lib/libncursesw.so ../
..using groonga-CMakeLists.txt.patch and editing libmariadb/cmake/ConnectorName.cmake line 25 to read ENDIF()
Title: Re: LAMP environment
Post by: MrToga on May 04, 2022, 02:34:45 AM
Hi,

After I add juanito's command in my cmake  like this :
Code: [Select]
sudo cmake \-DCURSES_CURSES_LIBRARY=/usr/local/lib/libncursesw.so \-DCURSES_FORM_LIBRARY=/usr/local/lib/libformw.so \-DCURSES_INCLUDE_PATH=/usr/local/include/ncursesw \-DCURSES_NCURSES_LIBRARY=/usr/local/lib/libncursesw.so \-WITH_PCRE:STRING=autoand I install curl-dev.
I'm currently doing the make and it's seem to keep going, he doesn't try to download pcre2 anymore
Title: Re: LAMP environment
Post by: Rich on May 04, 2022, 07:03:32 AM
Hi MrToga
If you are putting everything on 1 line, you should not include the  \  character.

Placing it at the end of a line like this tells the system "ignore this carriage return, I'm not done":
Code: [Select]
sudo cmake \
-DCURSES_CURSES_LIBRARY=/usr/local/lib/libncursesw.so \
-DCURSES_FORM_LIBRARY=/usr/local/lib/libformw.so \
-DCURSES_INCLUDE_PATH=/usr/local/include/ncursesw \
-DCURSES_NCURSES_LIBRARY=/usr/local/lib/libncursesw.so \
-WITH_PCRE:STRING=auto

Placing the  \  character anyplace else has a completely different meaning and can change the outcome of your command.
Title: Re: LAMP environment
Post by: MrToga on May 05, 2022, 12:29:37 AM
Hi guys,

After removing all the \ characters from my previous command and done à sudo make I get an error at the end of the make

Here the attached file
I also find out that in my mariadb/client/mysql.cc there is a line where the error occurs is :
Code: [Select]
static void my_vidattr(chtype attrs)
{
  if (have_curses)
      vidattr(attrs);
}

Maybe my ncurses.tcz is outdated ?
Any toughts ?

[attachment deleted by admin]
Title: Re: LAMP environment
Post by: Juanito on May 05, 2022, 01:50:04 AM
I gave it a try and the build failed at 97% done with:
Code: [Select]
mariadb-10.5.8/client/mysql.cc:105:13: error: variable or field 'my_vidattr' declared void
  105 | static void my_vidattr(chtype attrs)

I'd guess this is something to do with -std=gnu++11, gcc and the code used.

You could try a more recent version of mariadb?
Title: Re: LAMP environment
Post by: MrToga on May 05, 2022, 01:56:06 AM
Where can I found an newer version it doesn't seem to be a newer version for tiny core
Title: Re: LAMP environment
Post by: MrToga on May 05, 2022, 02:12:22 AM
I found where I can download some newer version of mariadb : https://mariadb.com/kb/en/mariadb-server-10-7-3/
I'm gonna try it with the 10.7.3 version
Title: Re: LAMP environment
Post by: MrToga on May 06, 2022, 12:25:29 AM
Update :

I still have the same error with the version 10.7.3
Title: Re: LAMP environment
Post by: Juanito on May 06, 2022, 12:32:22 AM
At 74% I get
Code: [Select]
/usr/local/bin/ld: ../lib/libgroonga.so: undefined reference to `provider_service_lz4_static'
collect2: error: ld returned 1 exit status
Title: Re: LAMP environment
Post by: MrToga on May 06, 2022, 12:45:24 AM
Strange I didn't get that

My error was at 96%  :
Code: [Select]
error : variable or field 'my_vidattr' declared voidlike the last version

Maybe you didn't install liblz4.tcz ?
Title: Re: LAMP environment
Post by: MrToga on May 06, 2022, 04:03:51 AM
Update :

I found something to make the copilation work
You need to write
Code: [Select]
#undef HAVE_VIDATR in /mariadb/client/mysql.cc above the line #ifdef HAVE_VIDATR
So I was wondering maybe in the cmake there's an option to configure this variable
Title: Re: LAMP environment
Post by: Juanito on May 06, 2022, 04:48:48 AM
The available options are listed with cmake -LAH
Title: Re: LAMP environment
Post by: MrToga on May 06, 2022, 05:15:35 AM
I was also wondering if I can increase the size of a repertory on tinyCore because during my make install my repertory /tmp doesn't have enough space to handle mariaDB.
Is it possible ?
Title: Re: LAMP environment
Post by: Rich on May 06, 2022, 08:26:27 AM
Hi MrToga
/tmp  is located in RAM, as is most of the file system. Create a work directory in  /mnt/mmblk0p2  if you are
running out of space.

... You need to write
Code: [Select]
#undef HAVE_VIDATR in /mariadb/client/mysql.cc above the line #ifdef HAVE_VIDATR ...
That may not be a good idea.  HAVE_VIDATR  is also referenced in  cmake/readline.cmake.

Open the  config.h.cmake  file and see if changing this:
Code: [Select]
#cmakedefine HAVE_VIDATTR 1to this:
Code: [Select]
#cmakedefine HAVE_VIDATTR 0makes the error go away.
Title: Re: LAMP environment
Post by: Juanito on May 12, 2022, 01:26:20 AM
I finally got mariadb-10.5.8 to build, see attached
Title: Re: LAMP environment
Post by: MrToga on May 12, 2022, 03:00:45 AM
Hi juanito,

Thanks for sharing but I gave up the idea of mariadb because during the make install I don't have enough space on my RAM to have mariaDB on my RPI3.
So I'm using sqlite3 instead with phpliteadmin to have a GUI (link here if you want : https://bitbucket.org/phpliteadmin/public/downloads/)

Thank for all.
Title: Re: LAMP environment
Post by: Juanito on May 12, 2022, 03:34:08 AM
I agree mariadb is heavy for a RPi3, but once it’s made into an extension it won’t use much ram.
Title: Re: LAMP environment
Post by: Juanito on May 12, 2022, 08:38:30 AM
mariadb extensions posted anyway - are you going to submit apache, libonig and php extensions?
Title: Re: LAMP environment
Post by: MrToga on May 13, 2022, 05:15:07 AM
Hi Juanito,
I can submit you apache but for php  I just created a php.tcz I don't have another thing  (same goes for libonig I just have onig.tcz) is it okay ?

But where do I submit ?
Title: Re: LAMP environment
Post by: Juanito on May 13, 2022, 06:54:24 AM
See: https://web.archive.org/web/20191011054952/http://wiki.tinycorelinux.net/wiki:creating_extensions

Submit the extensions to tcesubmit@gmail.com
Title: Re: LAMP environment
Post by: MrToga on May 30, 2022, 12:48:08 AM
php7 apache onig and libmcrypt submitted
Title: Re: LAMP environment
Post by: Juanito on May 30, 2022, 07:55:57 AM
Posted - thank you for your contribution  :)
Title: Re: LAMP environment
Post by: MrToga on May 30, 2022, 08:47:58 AM
My pleasure  ;D