localhost (and site) unable to search #40

Closed
opened 2024-10-07 00:37:56 +00:00 by bread · 57 comments
Contributor

Some system information before anything…

OpenRC, Artix Linux, Nginx, and, iwd as the connection manager.

I took some stuff from the 'real world' example from the Nginx page, Nginx throws no syntax errors, which is good. It works. Everything is good.

Basically, everything works except when it comes to accessing network-required pages, such as Search or the Instances browser. The Nginx configuration uses the port 2323 and the server 4g.stelladenihil.i2p. It being an eepsite has nothing to do, since if something manages the port set by i2p, it will just work.

I'll record an example if asked so. Here's the log if it helps:

2024/10/07 00:32:48 [error] 12865#12865: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function apcu_inc() in /var/www/4get/lib/bot_protection.php:10
Stack trace:
#0 /var/www/4get/web.php(19): bot_protection->__construct()
#1 {main}
  thrown in /var/www/4get/lib/bot_protection.php on line 10" while reading response header from upstream, client: 127.0.0.1, server: 4g.stelladenihil.i2p, request: "GET /web?s=4g HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "127.0.0.1:2323", referrer: "http://127.0.0.1:2323/"
Some system information before anything… OpenRC, Artix Linux, Nginx, and, `iwd` as the connection manager. I took some stuff from the 'real world' example from the Nginx page, Nginx throws no syntax errors, which is good. It works. **Everything is good**. Basically, everything works except when it comes to accessing network-required pages, such as Search or the Instances browser. The Nginx configuration uses the port `2323` and the server `4g.stelladenihil.i2p`. It being an eepsite has nothing to do, since if something manages the port set by i2p, it will just work. I'll record an example if asked so. <abbr title="NOTE: It doesn't matter if it is the eepsite or the localhost page. The log only alters slightly.">Here's the log if it helps</abbr>: ``` 2024/10/07 00:32:48 [error] 12865#12865: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function apcu_inc() in /var/www/4get/lib/bot_protection.php:10 Stack trace: #0 /var/www/4get/web.php(19): bot_protection->__construct() #1 {main} thrown in /var/www/4get/lib/bot_protection.php on line 10" while reading response header from upstream, client: 127.0.0.1, server: 4g.stelladenihil.i2p, request: "GET /web?s=4g HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "127.0.0.1:2323", referrer: "http://127.0.0.1:2323/" ```
Author
Contributor

Er, the result of the error is the search page result being a blank page. Forgot to mention.

Er, the result of the error is the search page result being a blank page. Forgot to mention.
bread closed this issue 2024-10-07 00:43:16 +00:00
Author
Contributor

WRONG BUTTON FUCKKKK

WRONG BUTTON FUCKKKK
bread reopened this issue 2024-10-07 00:43:51 +00:00
Owner

It tells you what to do. It failed to call apcu_inc, which is part of the APCU module. Please make sure you installed all of the required modules.

https://git.lolcat.ca/lolcat/4get/src/branch/master/docs/apache2.md

^the first thing it tells you to do here is to install the required modules. Now, some people have been dealing with some issues trying to install these packages on arch based systems, and often ended up using the docker container. But you seem to have found a way to install PHP, so you should be good I guess.

Let me know if this helps.

It tells you what to do. It failed to call `apcu_inc`, which is part of the APCU module. Please make sure you installed all of the required modules. https://git.lolcat.ca/lolcat/4get/src/branch/master/docs/apache2.md ^the first thing it tells you to do here is to install the required modules. Now, some people have been dealing with some issues trying to install these packages on arch based systems, and often ended up using the docker container. But you seem to have found a way to install PHP, so you should be good I guess. Let me know if this helps.
Author
Contributor

The PHP package for APCU isn't available in neither the AUR nor the Artix repositories. I'm going to look inside Arch's repositories, but I don't promise anything.

The PHP package for APCU isn't available in neither the AUR nor the Artix repositories. I'm going to look inside Arch's repositories, but I don't promise anything.
Author
Contributor

Apparently, it is in the extra repo. I installed it and:

2024/10/07 02:25:35 [error] 20236#20236: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function apcu_inc() in /var/www/4get/lib/bot_protection.php:10
Stack trace:
#0 /var/www/4get/web.php(19): bot_protection->__construct()
#1 {main}
  thrown in /var/www/4get/lib/bot_protection.php on line 10" while reading response header from upstream, client: 127.0.0.1, server: 4g.stelladenihil.i2p, request: "GET /web?s=test2 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "127.0.0.1:2323", referrer: "http://127.0.0.1:2323/"

I'm pretty sure that is the same error. Could I know if php-apcu runs as a service? Because that might mean I need to make a boot entry for it.

Apparently, it is in the `extra` repo. I installed it and: ``` 2024/10/07 02:25:35 [error] 20236#20236: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function apcu_inc() in /var/www/4get/lib/bot_protection.php:10 Stack trace: #0 /var/www/4get/web.php(19): bot_protection->__construct() #1 {main} thrown in /var/www/4get/lib/bot_protection.php on line 10" while reading response header from upstream, client: 127.0.0.1, server: 4g.stelladenihil.i2p, request: "GET /web?s=test2 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "127.0.0.1:2323", referrer: "http://127.0.0.1:2323/" ``` I'm pretty sure that is the same error. Could I know if `php-apcu` runs as a service? Because that might mean I need to make a boot entry for it.
Owner

Restart nginx. Also yes, it's a daemon.

Restart nginx. Also yes, it's a daemon.
Author
Contributor

I did. I restarted the php-fpm daemon, also. Also tried another php-apcu variant in the extra repository, didn't work also.

I did. I restarted the `php-fpm` daemon, also. Also tried another `php-apcu` variant in the `extra` repository, didn't work also.
Owner

I don't know brother, everyone who has tried getting this to work on arch has failed until they tried the docker container. Don't hate yourself too much if you can't get it to work.

I don't know brother, everyone who has tried getting this to work on arch has failed until they tried the docker container. Don't hate yourself too much if you can't get it to work.
Author
Contributor

I guess I'll close this then? I might re-open it if I find a fix. For now, I'll try to get it running via weird shit.

I guess I'll close this then? I might re-open it if I find a fix. For now, I'll try to get it running via weird shit.
bread closed this issue 2024-10-07 06:19:37 +00:00
Author
Contributor

Ok wait, I forgot to ask something: Should I probably clone the repository (or make a markdown file for you to commit) to update the nginx documentation? Especially to add the Arch Linux notice to it; alongside with what's known.

Ok wait, I forgot to ask something: Should I *probably* clone the repository *(or make a markdown file for you to commit)* to update the nginx documentation? Especially to add the Arch Linux notice to it; alongside with what's known.
bread reopened this issue 2024-10-07 06:25:19 +00:00
bread closed this issue 2024-10-07 06:25:24 +00:00
bread reopened this issue 2024-10-07 06:25:31 +00:00
Author
Contributor

fuck

fuck
Owner

Yeah that'd be good. :)

Yeah that'd be good. :)
Author
Contributor

Uh, @lolcat, could I know where your files for php-apcu are located? It might be a location issue, I tried looking at the Debian packages subdomain but I couldn't find something about the file locations.

EDIT: Nevermind, I found the file locations.

Uh, @lolcat, could I know where your files for `php-apcu` are located? It might be a location issue, I tried looking at the <a href="https://packages.debian.org/bookworm/php-apcu">Debian packages subdomain</a> but I couldn't find something about the file locations. EDIT: <a href="https://packages.debian.org/bookworm/amd64/php8.2-apcu/filelist">Nevermind, I found the file locations</a>.
Author
Contributor

It might just be something with the package, or something with configuration. Could you showcase your /etc/php/conf.d/apcu.ini file?

It might just be something with the package, or something with configuration. Could you showcase your `/etc/php/conf.d/apcu.ini` file?
Owner

The closest match I have is this

will@fuckedmachine:~$ cat /etc/php/8.2/cli/conf.d/20-apcu.ini 
extension=apcu.so

The path that probably matters is /etc/php/8.2/apache2/conf.d/20-apcu.ini though, since it's the one that's actually being used when you use apache2

The closest match I have is this ``` will@fuckedmachine:~$ cat /etc/php/8.2/cli/conf.d/20-apcu.ini extension=apcu.so ``` The path that probably matters is `/etc/php/8.2/apache2/conf.d/20-apcu.ini` though, since it's the one that's actually being used when you use apache2
Author
Contributor

Alright, for some reason my version contains it commented:

~> cat /etc/php/conf.d/apcu.ini                                                                   10/10/2024 11:39:39 PM
;extension=apcu.so

I removed it and restarted Nginx and…

~> sudo rc-service nginx restart                                                                10/10/2024 11:42:59 PM
 * WARNING: you are stopping a boot service
 * Checking nginx' configuration ... [ ok ]
 * Stopping nginx ... [ ok ]
 * Starting nginx ... [ ok ]
~> wget 'http://127.0.0.1:2323/'                                                                 10/10/2024 11:43:05 PM
--2024-10-10 23:43:11--  http://127.0.0.1:2323/
Connecting to 127.0.0.1:2323... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html.1’

index.html.1                                         [ <=>                                                                                                      ]   1.61K  --.-KB/s    in 0s      

2024-10-10 23:43:11 (145 MB/s) - ‘index.html.1’ saved [1653]

~> wget 'http://127.0.0.1:2323/web?s=search'
--2024-10-10 23:43:24--  http://127.0.0.1:2323/web?s=search
Connecting to 127.0.0.1:2323... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2024-10-10 23:43:24 ERROR 500: Internal Server Error.

Basically, the same:

2024/10/10 23:43:24 [error] 2963#2963: *3 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function apcu_inc() in /var/www/4get/lib/bot_protection.php:10
Stack trace:
#0 /var/www/4get/web.php(19): bot_protection->__construct()
#1 {main}
  thrown in /var/www/4get/lib/bot_protection.php on line 10" while reading response header from upstream, client: 127.0.0.1, server: 4g.stelladenihil.i2p, request: "GET /web?s=search HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "127.0.0.1:2323"

I'm thinking of editing the file which calls it, (which seems to be about cookies) but I'm a bit “special,” and will probably mess it up.

Alright, for some reason my version contains it commented: ```sh ~> cat /etc/php/conf.d/apcu.ini 10/10/2024 11:39:39 PM ;extension=apcu.so ``` I removed it and restarted Nginx and… ```sh ~> sudo rc-service nginx restart 10/10/2024 11:42:59 PM * WARNING: you are stopping a boot service * Checking nginx' configuration ... [ ok ] * Stopping nginx ... [ ok ] * Starting nginx ... [ ok ] ~> wget 'http://127.0.0.1:2323/' 10/10/2024 11:43:05 PM --2024-10-10 23:43:11-- http://127.0.0.1:2323/ Connecting to 127.0.0.1:2323... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘index.html.1’ index.html.1 [ <=> ] 1.61K --.-KB/s in 0s 2024-10-10 23:43:11 (145 MB/s) - ‘index.html.1’ saved [1653] ~> wget 'http://127.0.0.1:2323/web?s=search' --2024-10-10 23:43:24-- http://127.0.0.1:2323/web?s=search Connecting to 127.0.0.1:2323... connected. HTTP request sent, awaiting response... 500 Internal Server Error 2024-10-10 23:43:24 ERROR 500: Internal Server Error. ``` Basically, the same: ```sh 2024/10/10 23:43:24 [error] 2963#2963: *3 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function apcu_inc() in /var/www/4get/lib/bot_protection.php:10 Stack trace: #0 /var/www/4get/web.php(19): bot_protection->__construct() #1 {main} thrown in /var/www/4get/lib/bot_protection.php on line 10" while reading response header from upstream, client: 127.0.0.1, server: 4g.stelladenihil.i2p, request: "GET /web?s=search HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "127.0.0.1:2323" ``` I'm thinking of editing the file which calls it, (which seems to be about cookies) but I'm a bit *“special,”* and will probably mess it up.
Author
Contributor

Another also, I think /usr/lib/php/modules/apcu.somight be of importance? It seems like a binary. Sorta. Maybe. I'm also going to start <abbr> the locations from the file list.

Another also, I think <abbr title="/usr/lib/php/20220829/apcu.so"><code>/usr/lib/php/modules/apcu.so</code></abbr>might be of importance? It seems like a binary. Sorta. Maybe. I'm also going to start `<abbr>` the locations from the [file list](https://packages.debian.org/bookworm/amd64/php8.2-apcu/filelist).
Owner

APCU is needed for pagination to work. I store encrypted data inside apcu keys, and encrypt it. This is why when you paginate results, you get these random characters in your url bar. These random characters are actually the decryption key to the pagination data.

But yeah. I wouldn't go the compile PHP from source route, that is a huge pain in the ass. You need to figure out every module you need at compile time, so there's a lot of guesswork involved.

Could you link the thread you have made on Artix forums?

Oh, and one last thing. If you did manage to install php-apcu, can you edit your php.ini to contain the following directive?

extension=apcu.so
apc.enable_cli=1

Then, restart nginx & php-fpm

Tell me if that does anything for you.

APCU is needed for pagination to work. I store encrypted data inside apcu keys, and encrypt it. This is why when you paginate results, you get these random characters in your url bar. These random characters are actually the decryption key to the pagination data. But yeah. I wouldn't go the compile PHP from source route, that is a huge pain in the ass. You need to figure out every module you need at compile time, so there's a lot of guesswork involved. Could you link the thread you have made on Artix forums? Oh, and one last thing. If you did manage to install php-apcu, can you edit your php.ini to contain the following directive? ``` extension=apcu.so apc.enable_cli=1 ``` Then, restart nginx & php-fpm Tell me if that does anything for you.
Author
Contributor

Oh fuck. It works.

I didn't set my proxy settings right, so don't worry about it.

Oh fuck. It works. ![](https://0.vern.cc/od.png) I didn't set my proxy settings right, so don't worry about it.
Owner

When it renders half of it that means it crashed somewhere, are you sure

When it renders half of it that means it crashed somewhere, are you sure
Author
Contributor

It wasn't that. Maybe I should avoid guessing this time.

It wasn't that. Maybe I should avoid guessing this time.
Author
Contributor

Let me show you the logs real quick…

2024/10/11 00:41:40 [error] 6933#6933: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function sodium_crypto_secretbox_keygen() in /var/www/4get/lib/backend.php:97
Stack trace:
#0 /var/www/4get/scraper/ddg.php(1622): backend->store()
#1 /var/www/4get/web.php(30): ddg->web()
#2 {main}
  thrown in /var/www/4get/lib/backend.php on line 97" while reading upstream, client: 127.0.0.1, server: 4g.stelladenihil.i2p, request: "GET /web?s=IT+WORK%21 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "127.0.0.1:2323", referrer: "http://127.0.0.1:2323/"
Let me show you the logs real quick… ```sh 2024/10/11 00:41:40 [error] 6933#6933: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function sodium_crypto_secretbox_keygen() in /var/www/4get/lib/backend.php:97 Stack trace: #0 /var/www/4get/scraper/ddg.php(1622): backend->store() #1 /var/www/4get/web.php(30): ddg->web() #2 {main} thrown in /var/www/4get/lib/backend.php on line 97" while reading upstream, client: 127.0.0.1, server: 4g.stelladenihil.i2p, request: "GET /web?s=IT+WORK%21 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "127.0.0.1:2323", referrer: "http://127.0.0.1:2323/" ```
Owner

Yes! That's the extension I use to encrypt the npt tokens for pagination.

You need this extension: https://github.com/jedisct1/libsodium-php

Is it available in the repos?

Yes! That's the extension I use to encrypt the npt tokens for pagination. You need this extension: https://github.com/jedisct1/libsodium-php Is it available in the repos?
Author
Contributor

It seems to be in the AUR, php80-sodium (along those lines)

It seems to be in the AUR, `php80-sodium` (along those lines)
Author
Contributor

So, basically, I can't. It requires libsystemd.

So, basically, I can't. It requires `libsystemd`.
Author
Contributor

The PECL extension manager isn't on the main repositories, and the AUR package might be from the same folk.

The PECL extension manager isn't on the main repositories, and the AUR package might be from the same folk.
Owner

it requires systemd

what the hell?

Ok, if you can't get this to work, I can try moving to using openSSL extension. Is there a way for you to set that up?

>it requires systemd what the hell? Ok, if you can't get this to work, I can try moving to using openSSL extension. Is there a way for you to set *that* up?
Author
Contributor

I suppose that it is also a package, yes?

I suppose that it is also a *package*, yes?
Owner

It's an extension, I believe. Does your package provider really not bundle ANY extensions at all? Can you even decode JSON?

Can you run these tests for me?

$ php -a
php > print_r(json_decode('{"test":null}'));
stdClass Object
(
    [test] => 
)
php > print_r(openssl_pkey_new([]));
OpenSSLAsymmetricKey Object
(
)

It's an extension, I believe. Does your package provider really not bundle ANY extensions at all? Can you even decode JSON? Can you run these tests for me? ``` $ php -a php > print_r(json_decode('{"test":null}')); stdClass Object ( [test] => ) php > print_r(openssl_pkey_new([])); OpenSSLAsymmetricKey Object ( ) ```
Author
Contributor

I don't think I can:

php > print_r(json_decode('{"test":null}'));
stdClass Object
(
    [test] => 
)
php > print_r(openssl_pkey_new([]));
OpenSSLAsymmetricKey Object
(
)
php > print("Nothing!")
php > 
I don't think I can: ```php php > print_r(json_decode('{"test":null}')); stdClass Object ( [test] => ) php > print_r(openssl_pkey_new([])); OpenSSLAsymmetricKey Object ( ) php > print("Nothing!") php > ```
Author
Contributor

If possible, I'll beat the other Artix issue in terms of comments.

If possible, I'll beat the other Artix issue in terms of comments.
Owner

you didn't get any errors. OpenSSL should work

you didn't get any errors. OpenSSL should work
Author
Contributor

you didn't get any errors. OpenSSL should work

Is print() really supposed not to print, though?

> you didn't get any errors. OpenSSL should work Is `print()` really supposed not to print, though?
Owner

You forgot the ;

You forgot the `;`
Author
Contributor

even worse:
PHP Parse error: syntax error, unexpected identifier "Object" in php shell code on line 2

even worse: `PHP Parse error: syntax error, unexpected identifier "Object" in php shell code on line 2`
Owner

Just reset your shell. If you don't put a ; last command will be appended to the current one.

Just reset your shell. If you don't put a `;` last command will be appended to the current one.
Author
Contributor

Okay, nevermind, it was the !. Continue

Okay, nevermind, it was the `!`. Continue
Author
Contributor

Okay so, I don't remember if I mentioned that I installed world/php-sodium, which does nothing for some reason??? I mean, it's probably for other use cases but still, the fuck???

Okay so, I don't remember if I mentioned that I installed `world/php-sodium`, which does nothing for some reason??? I mean, it's probably for other use cases but still, the fuck???
Owner

Can you make sure libsodium is loaded?

will@fuckedmachine:~$ php -r "phpinfo();" | grep sodium
sodium
sodium support => enabled
libsodium headers version => 1.0.18
libsodium library version => 1.0.18

If not, load the required module in php.ini

Can you make sure libsodium is loaded? ``` will@fuckedmachine:~$ php -r "phpinfo();" | grep sodium sodium sodium support => enabled libsodium headers version => 1.0.18 libsodium library version => 1.0.18 ``` If not, load the required module in php.ini
Author
Contributor

It just gives a bunch of flags:

Configure Command =>  './configure'  '--srcdir=../php-8.3.12' '--config-cache' '--prefix=/usr' '--sbindir=/usr/bin' '--sysconfdir=/etc/php' '--localstatedir=/var' '--with-layout=GNU' '--with-config-file-path=/etc/php' '--with-config-file-scan-dir=/etc/php/conf.d' '--disable-rpath' '--mandir=/usr/share/man' '--enable-cgi' '--enable-fpm' '--without-fpm-systemd' '--with-fpm-acl' '--with-fpm-user=http' '--with-fpm-group=http' '--enable-embed=shared' '--enable-bcmath=shared' '--enable-calendar=shared' '--enable-dba=shared' '--enable-exif=shared' '--enable-ftp=shared' '--enable-gd=shared' '--enable-intl=shared' '--enable-mbstring' '--enable-pcntl' '--enable-shmop=shared' '--enable-soap=shared' '--enable-sockets=shared' '--enable-sysvmsg=shared' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--with-bz2=shared' '--with-curl=shared' '--with-enchant=shared' '--with-external-gd' '--with-external-pcre' '--with-ffi=shared' '--with-gdbm' '--with-gettext=shared' '--with-gmp=shared' '--with-iconv=shared' '--with-kerberos' '--with-ldap=shared' '--with-ldap-sasl' '--with-mhash' '--with-mysql-sock=/run/mysqld/mysqld.sock' '--with-mysqli=shared' '--with-openssl' '--with-password-argon2' '--with-pdo-dblib=shared,/usr' '--with-pdo-mysql=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-pgsql=shared' '--with-pdo-sqlite=shared' '--with-pgsql=shared' '--with-pspell=shared' '--with-readline' '--with-snmp=shared' '--with-sodium=shared' '--with-sqlite3=shared' '--with-tidy=shared' '--with-unixODBC=shared' '--with-xsl=shared' '--with-zip=shared' '--with-zlib' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection' 'LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs' 'CXXFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS'

Related to sodium is:
--with-sodium=shared

Here's php-config's output:

Usage: /usr/bin/php-config [OPTION]
Options:
  --prefix            [/usr]
  --includes          [-I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib]
  --ldflags           []
  --libs              [  -lreadline -lncurses -lrt -lstdc++ -lrt -lm -lacl  -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lpcre2-8 -lz -lxml2 -lonig -lxml2 -largon2 -lrt -ldl -lxml2 -lxml2 -lxml2 -lz -lssl -lcrypto ]
  --extension-dir     [/usr/lib/php/modules]
  --include-dir       [/usr/include/php]
  --man-dir           [/usr/share/man]
  --php-binary        [/usr/bin/php]
  --php-sapis         [ cli embed fpm phpdbg cgi]
  --ini-path          [/etc/php]
  --ini-dir           [/etc/php/conf.d]
  --configure-options [ 'same as the above codeblock' ]
  --version           [8.3.12]
  --vernum            [80312]
It just gives a bunch of flags: ```sh Configure Command => './configure' '--srcdir=../php-8.3.12' '--config-cache' '--prefix=/usr' '--sbindir=/usr/bin' '--sysconfdir=/etc/php' '--localstatedir=/var' '--with-layout=GNU' '--with-config-file-path=/etc/php' '--with-config-file-scan-dir=/etc/php/conf.d' '--disable-rpath' '--mandir=/usr/share/man' '--enable-cgi' '--enable-fpm' '--without-fpm-systemd' '--with-fpm-acl' '--with-fpm-user=http' '--with-fpm-group=http' '--enable-embed=shared' '--enable-bcmath=shared' '--enable-calendar=shared' '--enable-dba=shared' '--enable-exif=shared' '--enable-ftp=shared' '--enable-gd=shared' '--enable-intl=shared' '--enable-mbstring' '--enable-pcntl' '--enable-shmop=shared' '--enable-soap=shared' '--enable-sockets=shared' '--enable-sysvmsg=shared' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--with-bz2=shared' '--with-curl=shared' '--with-enchant=shared' '--with-external-gd' '--with-external-pcre' '--with-ffi=shared' '--with-gdbm' '--with-gettext=shared' '--with-gmp=shared' '--with-iconv=shared' '--with-kerberos' '--with-ldap=shared' '--with-ldap-sasl' '--with-mhash' '--with-mysql-sock=/run/mysqld/mysqld.sock' '--with-mysqli=shared' '--with-openssl' '--with-password-argon2' '--with-pdo-dblib=shared,/usr' '--with-pdo-mysql=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-pgsql=shared' '--with-pdo-sqlite=shared' '--with-pgsql=shared' '--with-pspell=shared' '--with-readline' '--with-snmp=shared' '--with-sodium=shared' '--with-sqlite3=shared' '--with-tidy=shared' '--with-unixODBC=shared' '--with-xsl=shared' '--with-zip=shared' '--with-zlib' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection' 'LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs' 'CXXFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS' ``` Related to sodium is: `--with-sodium=shared` Here's `php-config`'s output: ```sh Usage: /usr/bin/php-config [OPTION] Options: --prefix [/usr] --includes [-I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib] --ldflags [] --libs [ -lreadline -lncurses -lrt -lstdc++ -lrt -lm -lacl -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lpcre2-8 -lz -lxml2 -lonig -lxml2 -largon2 -lrt -ldl -lxml2 -lxml2 -lxml2 -lz -lssl -lcrypto ] --extension-dir [/usr/lib/php/modules] --include-dir [/usr/include/php] --man-dir [/usr/share/man] --php-binary [/usr/bin/php] --php-sapis [ cli embed fpm phpdbg cgi] --ini-path [/etc/php] --ini-dir [/etc/php/conf.d] --configure-options [ 'same as the above codeblock' ] --version [8.3.12] --vernum [80312] ```

So, basically, I can't. It requires libsystemd.

Are you sure? I think that the AUR package have all of them you can compile it following this:

prepare() {
	sed -i 's/PHP_FPM_SYSTEMD\" \!\= \"no/PHP_FPM_SYSTEMD\" \=\= "\fuuuu/g' "php-8.3.7/sapi/fpm/config.m4"

Now it is not needed anymore though?
And this may be unrelated not sure.

> So, basically, I can't. It requires `libsystemd`. Are you sure? I think that the AUR package have all of them you can compile it following [this](https://forum.artixlinux.org/index.php/topic,5712.msg42305.html#msg42305): ``` prepare() { sed -i 's/PHP_FPM_SYSTEMD\" \!\= \"no/PHP_FPM_SYSTEMD\" \=\= "\fuuuu/g' "php-8.3.7/sapi/fpm/config.m4" ``` Now it is not needed anymore though? And this may be unrelated not sure.
Author
Contributor

Let me try that. If it doesn't work, I'll try doing a symlink with elogind to where ever libsystemd is stored.

Let me try that. If it doesn't work, I'll try doing a symlink with `elogind` to where ever `libsystemd` is stored.
Author
Contributor

Yeah.

sed: can't read php-8.3.7/sapi/fpm/config.m4: No such file or directory
==> ERROR: A failure occurred in prepare().
    Aborting...
error: failed to build 'php80'
Yeah. ```sh sed: can't read php-8.3.7/sapi/fpm/config.m4: No such file or directory ==> ERROR: A failure occurred in prepare(). Aborting... error: failed to build 'php80' ```
Author
Contributor

I'll also see if I can find out how to actually post in the forums -- It might be a You can post after xx/xx/xx AM-thing but I'm not sure.

I'll also see if I can find out how to actually post in the forums -- It might be a `You can post after xx/xx/xx AM`-thing but I'm not sure.

@bread I built

_phpbase="83"
_suffix=""
pkgver="8.3.7"
pkgrel="1"
pkgbase="php83"
pkgdesc="PHP 8.3.7 compiled as to not conflict with mainline php"

Using that.
I have x86 packages if you want them.

As fair as I know you can post in the forum but you have to wait 1or 2? minutes between posts.

@bread I built ``` _phpbase="83" _suffix="" pkgver="8.3.7" pkgrel="1" pkgbase="php83" pkgdesc="PHP 8.3.7 compiled as to not conflict with mainline php" ``` Using that. I have x86 packages if you want them. As fair as I know you can post in the forum but you have to wait 1or 2? minutes between posts.
Author
Contributor

I made an account but it got terminated; it might've been the fact that I was using an alias, but it seems stupid, since the email never arrived.

And, feel free to pass me the package! It really is just the current best choice for me. The other would be to use Docker, but I'd rather not.

I made an account but it got terminated; it might've been the fact that I was using an alias, but it seems stupid, since the email *never* arrived. And, feel free to pass me the package! It really is just the current best choice for me. The other would be to use Docker, <abbr title="I've got a bit of hatred in me for it, but that's off-topic.">but I'd rather not.</abbr>

I built php83 for 4get but in the end I used docker I do not know to how do it without.
Do you need php80 instead?

You need to change the sed command to right file.
I extracted the source and it is in php-8.0.30/sapi/fpm/config.m4.
The error shows that you tried 8.3.7 version.
Check that the path is correct if you get an error again.

Here there are the files.

I built php83 for 4get but in the end I used docker I do not know to how do it without. Do you need php80 instead? You need to change the sed command to right file. I extracted the source and it is in `php-8.0.30/sapi/fpm/config.m4`. The error shows that you tried 8.3.7 version. Check that the path is correct if you get an error again. Here there are the files.
Owner

php83 is better, yes. It's a patch for php8.

php83 is better, yes. It's a patch for php8.
Author
Contributor

Ok, so basically:

[shitbox /]# tar xfv php83-sodium-8.3.7-1-x86_64.pkg.tar.zst
.BUILDINFO
.MTREE
.PKGINFO
etc/
etc/php83/
etc/php83/conf.d/
etc/php83/conf.d/20-sodium.ini
usr/
usr/lib/
usr/lib/php83/
usr/lib/php83/modules/
usr/lib/php83/modules/sodium.so
[shitbox /]# rm -rf .BUILDINFO .MTREE .PKGINFO 
[shitbox /]# ls /etc/php
php/   php83/ 
[shitbox /]# ls /etc/php83
conf.d
[shitbox /]# mv /etc/php83/conf.d/20-sodium.ini /etc/php/conf.d/20-sodium.ini
[shitbox /]# mv /usr/lib/php83/modules/sodium.so /usr/lib/php/modules/sodium.so
[shitbox /]# rm -rf php83-sodium-8.3.7-1-x86_64.pkg.tar.zst 

You just have to place the files where they should be — And, I don't know if I mentioned, but the AUR package did try to build php83 from scratch (for some reason the compilation process for a single PHP package requires libsystemd (and also to bulid the entire thing)). Unpractical, but works.

Ok, so basically: ```sh [shitbox /]# tar xfv php83-sodium-8.3.7-1-x86_64.pkg.tar.zst .BUILDINFO .MTREE .PKGINFO etc/ etc/php83/ etc/php83/conf.d/ etc/php83/conf.d/20-sodium.ini usr/ usr/lib/ usr/lib/php83/ usr/lib/php83/modules/ usr/lib/php83/modules/sodium.so [shitbox /]# rm -rf .BUILDINFO .MTREE .PKGINFO [shitbox /]# ls /etc/php php/ php83/ [shitbox /]# ls /etc/php83 conf.d [shitbox /]# mv /etc/php83/conf.d/20-sodium.ini /etc/php/conf.d/20-sodium.ini [shitbox /]# mv /usr/lib/php83/modules/sodium.so /usr/lib/php/modules/sodium.so [shitbox /]# rm -rf php83-sodium-8.3.7-1-x86_64.pkg.tar.zst ``` You just have to place the files where they should be — And, I don't know if I mentioned, but the AUR package *did* try to build `php83` from scratch *(for some reason the compilation process for **a single PHP package** requires `libsystemd` (and also to bulid the entire thing))*. Unpractical, but works.
Author
Contributor

Image proof because I forgot to:

Image proof because I forgot to: ![](https://ayaya.beauty/jcw) ![](https://ayaya.beauty/r9D)
Author
Contributor

Big thanks to everyone who helped me with this dogshit issue, especially Will for giving me someone to talk to. I'll see if I can make AT LEAST some notices to the AUR package maintainer(s) or a post in Artix's forums to tell them about packaging php-libsodium and not whatever php-sodium is. I'll as well modify the Nginx documentation markdown file, just because.

Big thanks to everyone who helped me with this dogshit issue, especially Will for giving me someone to talk to. I'll see if I can make AT LEAST some notices to the AUR package maintainer(s) or a post in Artix's forums to tell them about packaging `php-libsodium` and not whatever `php-sodium` is. I'll as well modify the Nginx documentation markdown file, just because.

I'd like to run this on Artix too.
Can you explain how do it?

I'd like to run this on Artix too. Can you explain how do it?
Author
Contributor

Basically, uncompress php83-sodium-8.3.7-1-x86_64.pkg.tar.zst (from uncompressing your tarball, or downloading from somewhere else) and move etc/php83/conf.d/20-sodium.ini and usr/lib/php83/modules/sodium.so to their respective place in /, replacing ‘php83’ with just ‘php’.

...Alternatively, uncompress the tarball and modify the .PKGINFO to remove everything that isn't needed. Here's what it looks like without edits, if you're curious:

# Generated by makepkg 6.1.0
# using fakeroot version 1.35
pkgname = php83-sodium
pkgbase = php83
xdata = pkgtype=split
pkgver = 8.3.7-1
pkgdesc = sodium (libsodium) module for php83
url = http://www.php.net
builddate = 1718461520
packager = Unknown Packager
size = 100396
arch = x86_64
license = PHP
depend = php83=8.3.7
depend = libsodium
makedepend = acl
makedepend = libtool
makedepend = autoconf
makedepend = automake
makedepend = patchelf
makedepend = gawk
makedepend = sed
makedepend = bash
makedepend = python
makedepend = libxml2
makedepend = pam
makedepend = krb5
makedepend = zlib
makedepend = libedit
makedepend = smtp-forwarder
makedepend = pcre
makedepend = apache
makedepend = ncurses
makedepend = libxcrypt
makedepend = systemd
makedepend = systemd-libs
makedepend = coreutils
makedepend = findutils
makedepend = argon2
makedepend = libxslt
makedepend = e2fsprogs
makedepend = openssl
makedepend = lmdb
makedepend = db5.3
makedepend = postgresql-libs
makedepend = unixodbc
makedepend = libfbclient
makedepend = freetds
makedepend = sqlite
makedepend = gd
makedepend = tidy
makedepend = gmp
makedepend = libzip
makedepend = oniguruma
makedepend = aspell
makedepend = enchant
makedepend = libvoikko
makedepend = hspell
makedepend = hunspell
makedepend = nuspell
makedepend = aspell
makedepend = icu
makedepend = curl
makedepend = net-snmp
makedepend = libsasl
makedepend = libldap
makedepend = c-client
makedepend = pam
makedepend = libsodium
makedepend = libffi
checkdepend = procps-ng
checkdepend = smtp-forwarder

Then, compress it again to a tarball and finally run sudo pacman -U /path/to/file.pkg.tar.zst.

Basically, uncompress `php83-sodium-8.3.7-1-x86_64.pkg.tar.zst` (from uncompressing your tarball, or downloading from somewhere else) and move `etc/php83/conf.d/20-sodium.ini` and `usr/lib/php83/modules/sodium.so` to their respective place in `/`, replacing ‘php83’ with just ‘php’. ...Alternatively, uncompress the tarball and modify the `.PKGINFO` to remove everything that isn't needed. Here's what it looks like without edits, if you're curious: <details> ```sh # Generated by makepkg 6.1.0 # using fakeroot version 1.35 pkgname = php83-sodium pkgbase = php83 xdata = pkgtype=split pkgver = 8.3.7-1 pkgdesc = sodium (libsodium) module for php83 url = http://www.php.net builddate = 1718461520 packager = Unknown Packager size = 100396 arch = x86_64 license = PHP depend = php83=8.3.7 depend = libsodium makedepend = acl makedepend = libtool makedepend = autoconf makedepend = automake makedepend = patchelf makedepend = gawk makedepend = sed makedepend = bash makedepend = python makedepend = libxml2 makedepend = pam makedepend = krb5 makedepend = zlib makedepend = libedit makedepend = smtp-forwarder makedepend = pcre makedepend = apache makedepend = ncurses makedepend = libxcrypt makedepend = systemd makedepend = systemd-libs makedepend = coreutils makedepend = findutils makedepend = argon2 makedepend = libxslt makedepend = e2fsprogs makedepend = openssl makedepend = lmdb makedepend = db5.3 makedepend = postgresql-libs makedepend = unixodbc makedepend = libfbclient makedepend = freetds makedepend = sqlite makedepend = gd makedepend = tidy makedepend = gmp makedepend = libzip makedepend = oniguruma makedepend = aspell makedepend = enchant makedepend = libvoikko makedepend = hspell makedepend = hunspell makedepend = nuspell makedepend = aspell makedepend = icu makedepend = curl makedepend = net-snmp makedepend = libsasl makedepend = libldap makedepend = c-client makedepend = pam makedepend = libsodium makedepend = libffi checkdepend = procps-ng checkdepend = smtp-forwarder ``` </details> Then, compress it again to a tarball and finally run `sudo pacman -U /path/to/file.pkg.tar.zst`.

Your previous thread was clear with all the commands it's all the rest that I do not know to how do it.
Did you use this https://git.lolcat.ca/lolcat/4get/src/branch/master/docs/apache2.md?

Your previous thread was clear with all the commands it's all the rest that I do not know to how do it. Did you use this https://git.lolcat.ca/lolcat/4get/src/branch/master/docs/apache2.md?
Author
Contributor

@root
Consider looking at my fork, it has an updated Nginx guide:
https://git.lolcat.ca/bread/4get/src/branch/master/docs/nginx.md

@root Consider looking at my fork, it has an updated Nginx guide: https://git.lolcat.ca/bread/4get/src/branch/master/docs/nginx.md
Owner

Awesome, I'm happy you managed to figure it out. Is the nginx guide missing anything or are you ready to merge?

Awesome, I'm happy you managed to figure it out. Is the nginx guide missing anything or are you ready to merge?
Author
Contributor

Nah, it's not really missing anything. I think those are all the fixes I wanted to apply.

Nah, it's not really missing anything. I think those are all the fixes I wanted to apply.
bread closed this issue 2024-10-20 22:29:22 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lolcat/4get#40
No description provided.