Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please update for PHP80 #5

Open
hitched97 opened this issue May 12, 2021 · 43 comments
Open

Please update for PHP80 #5

hitched97 opened this issue May 12, 2021 · 43 comments

Comments

@hitched97
Copy link

Does not build as-is for php80. Removing all occurrences of TSRMLS_C, TSRMLS_CC, TSRMLS_DC, and TSRMLS_FETCH allows it to compile, but then every invocation of PHP spews a 'Missing arginfo' message for every defined radius function.

@Jan-E
Copy link
Contributor

Jan-E commented Aug 11, 2021

Even if it builds, the arginfo definitions are missing:

Warning: Missing arginfo for radius_auth_open()
Warning: Missing arginfo for radius_acct_open()
Warning: Missing arginfo for radius_close()
Warning: Missing arginfo for radius_strerror()
Warning: Missing arginfo for radius_config()
Warning: Missing arginfo for radius_add_server()
Warning: Missing arginfo for radius_create_request()
Warning: Missing arginfo for radius_put_string()
Warning: Missing arginfo for radius_put_int()
Warning: Missing arginfo for radius_put_attr()
Warning: Missing arginfo for radius_put_addr()
Warning: Missing arginfo for radius_put_vendor_string()
Warning: Missing arginfo for radius_put_vendor_int()
Warning: Missing arginfo for radius_put_vendor_attr()
Warning: Missing arginfo for radius_put_vendor_addr()
Warning: Missing arginfo for radius_send_request()
Warning: Missing arginfo for radius_get_attr()
Warning: Missing arginfo for radius_get_tagged_attr_data()
Warning: Missing arginfo for radius_get_tagged_attr_tag()
Warning: Missing arginfo for radius_get_vendor_attr()
Warning: Missing arginfo for radius_cvt_addr()
Warning: Missing arginfo for radius_cvt_int()
Warning: Missing arginfo for radius_cvt_string()
Warning: Missing arginfo for radius_salt_encrypt_attr()
Warning: Missing arginfo for radius_request_authenticator()
Warning: Missing arginfo for radius_server_secret()
Warning: Missing arginfo for radius_demangle()
Warning: Missing arginfo for radius_demangle_mppe_key()

@jkroonza
Copy link

jkroonza commented Nov 3, 2022

I note there are two pull requests open for this, but neither has been merged yet, how can we make progress here and is there anything we can do to help? Never worked with a php/pecl module yet, so if there is a guide on how to approach this, or pointers, I'd be happy to see if we can dedicate resources on this. Lots of info out there on how to migrate PHP code itself ... but I can't find anything on the modules themselves. Happy to assist with both code and testing.

@alexmontoanelli
Copy link

HI, try this.

Get the source of this package ready for php 8
https://github.com/UNETVALE/php-radius/archive/refs/heads/master.zip

Unpack and build with php tools for php 8 or php.81.
unzip master.zip && cd php-radius-master && phpize && ./configure && make && make install

Load the extension on your own php.ini file.

@Jan-E
Copy link
Contributor

Jan-E commented Nov 3, 2022

Which is the archive taken from https://github.com/UNETVALE/php-radius
It is just the same as this repo would be after merging #6
But #9 is probably a better PR.

@jkroonza
Copy link

OK, neither #6 or #9 is working for me.

Trying to apply directly on top of the archive at https://pecl.php.net/get/radius-1.4.0b1.tgz

#6 states as the first commit that it's importing that archive, so skipping over the first I get similar compile errors to #9.

#9 doesn't actually fix PHP8 compatibility and after applying it the build still only works for PHP7.4, not for PHP8.0 or PHP8.1.

Unfortunately I'm not permitted to just grab and use the archives as proposed.

@mbretter
Copy link
Collaborator

I have just merged #9, it would be great if someone can do some testing and file some PRs if there are issues.

I have initially created this package, but have not worked on this more almost 20yrs, though I have not the permissions to transfer the ownership, I can merge PRs.

@jkroonza
Copy link

The news is not good. At least not for php8.1.

make.log
config.log
configure.log

config.log is generated by ./configure, configure.log is the CLI output from ./configure.

Similar failures for php8.0.

@maticomba
Copy link

The same errors as @jkroonza reported in Ubuntu 22.04.1 LTS.

# php -v
PHP 8.1.2-1ubuntu2.9 (cli) (built: Oct 19 2022 14:58:09) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.9, Copyright (c), by Zend Technologies

@StephenWall
Copy link

I have a working patch for PHP 8.0.12, I will see about getting corporate permission to provide it here.

@StephenWall
Copy link

Here's my php 8 patch

php-radius.diff.gz

@jkroonza
Copy link

And the one Gentoo ended up using, which is what was merged (as I understand) + a few other changes to work around the errors I encountered.

1.4.0-php8.patch.gz

This applies on top of the archive from pecl for 1.4.0. I can confirm it works for 8.0 and 8.1, and according to the person that wrote it for 8.2 as well, but I'm not in a position to test that.

DISCLAIMER: I did not write this, the commit entry that added this into Gentoo reads as follows:

commit 6a43f0c27da369f2428587735b2cf6f46c8c49a3
Author: Brian Evans <[email protected]>
Date:   Tue Dec 13 11:00:22 2022 -0500

    dev-php/pecl-radius: Patch 8.0 support from upstream repo
    
    Adds in additional support missing upstream
    
    Closes: https://bugs.gentoo.org/881465
    Signed-off-by: Brian Evans <[email protected]>

@mbretter
Copy link
Collaborator

mbretter commented Dec 15, 2022

I have applied the patch above to a new php8 branch.
I had to go 2 commits back to be able to apply the patchset:
34cb80d45482756d8400e34dc148c7686ed5d58d

Could you please check if the php8 branch has a working codebase?

@alexmontoanelli
Copy link

I was unable to build foi master too.

Using my own repo with my fixes, was solid good.

https://github.com/alexmontoanelli/php-radius

@StephenWall
Copy link

My patch applies to 1.4.0b1 available from pecl.php.net, as this is what FreeBSD includes in their ports tree. Sorry, I'm not sure how that relates to the master branch here.

@StephenWall
Copy link

Oh, also, FreeBSD distributes a patch that removes all the TSRMLS stuff, so I did not address that in my patch.

@mbretter
Copy link
Collaborator

Sorry, there are many patches around, it gets a bit confusing.
I have merged a PR which is not working.
The patchset above should work?, so I tried them applying to master, which was not working, because master has already some of the changes, so I rolled back until the patches could be applied.

There is a branch 1.4.0b1, those patchset is meant to be applied to this branch?

Anyway, a clean well tested PR would be great.

@Jan-E
Copy link
Contributor

Jan-E commented Dec 15, 2022

Oh, also, FreeBSD distributes a patch that removes all the TSRMLS stuff, so I did not address that in my patch.

This was a part of #6: d2d10e1

All the TSRMLS stuff did not do anything at all in PHP 7, so it is safe to remove them for PHP 7+

@Jan-E
Copy link
Contributor

Jan-E commented Dec 15, 2022

And the removal of the TSRMLS stuff was not present in the merged #9 so it should be applied to master as well.

@StephenWall
Copy link

My understanding is that it's best to create a *.stub.php, and use the gen_stubs.php program provided with PHP8 to auto-generate the *_arginfo.h. This is what I did in my patch.

@Jan-E
Copy link
Contributor

Jan-E commented Dec 15, 2022

That is another way of dealing with the stubs. But it does not solve the issue at the moment: making master compatible with PHP 8.2. For this the TSRMLS stuff has to be removed first. So d2d10e1 has to be applied to master now. I will create a new PR for that.

Afterwards you could always create a pull request to generate the arginfo.h files with gen_stub.php. Posting patches in a *.gz form in this issue is not helpful at all. Use a pull request if you want to update this repo.

@Jan-E
Copy link
Contributor

Jan-E commented Dec 15, 2022

New PR: #11

@mbretter
Copy link
Collaborator

merged #11, pls test

@mbretter
Copy link
Collaborator

php8.2:

/bin/bash /data/www/php-radius/libtool --mode=compile cc -I. -I/data/www/php-radius -I/data/www/php-radius/include -I/data/www/php-radius/main -I/data/www/php-radius -I/usr/include/php/20220829 -I/usr/include/php/20220829/main -I/usr/include/php/20220829/TSRM -I/usr/include/php/20220829/Zend -I/usr/include/php/20220829/ext -I/usr/include/php/20220829/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE    -DZEND_COMPILE_DL_EXT=1 -c /data/www/php-radius/radlib.c -o radlib.lo  -MMD -MF radlib.dep -MT radlib.lo
libtool: compile:  cc -I. -I/data/www/php-radius -I/data/www/php-radius/include -I/data/www/php-radius/main -I/data/www/php-radius -I/usr/include/php/20220829 -I/usr/include/php/20220829/main -I/usr/include/php/20220829/TSRM -I/usr/include/php/20220829/Zend -I/usr/include/php/20220829/ext -I/usr/include/php/20220829/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /data/www/php-radius/radlib.c -MMD -MF radlib.dep -MT radlib.lo  -fPIC -DPIC -o .libs/radlib.o
/data/www/php-radius/radlib.c: In function ‘rad_auth_open’:
/data/www/php-radius/radlib.c:751:68: error: too many arguments to function ‘php_combined_lcg’
  751 |                 php_srand(time(NULL) * getpid() * (unsigned long) (php_combined_lcg(NULL) * 10000.0));
      |                                                                    ^~~~~~~~~~~~~~~~
In file included from /usr/include/php/20220829/ext/standard/php_rand.h:1,
                 from /data/www/php-radius/radlib_compat.h:42,
                 from /data/www/php-radius/radlib.c:52:
/usr/include/php/20220829/ext/random/php_random.h:34:15: note: declared here
   34 | PHPAPI double php_combined_lcg(void);
      |               ^~~~~~~~~~~~~~~~
make: *** [Makefile:212: radlib.lo] Error 1

@Jan-E
Copy link
Contributor

Jan-E commented Dec 16, 2022

Could you post the definition of php_combined_lcg in
/usr/include/php/20220829/ext/random/php_random.h ?

@mbretter
Copy link
Collaborator

mbretter commented Dec 16, 2022

hmm, there must be a build issue with different php versions on my system.
It includes the wrong PHP Api, for php7.4 it should be 20190902 but it uses 20220829, which is php8.2. PHP8.2 had some changes regarding the random number generation.

What I did was:
phpize7.4
./configure
make

/data/www/php-radius$ phpize7.4 
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902

But configure sets:

checking for PHP includes... -I/usr/include/php/20220829 -I/usr/include/php/20220829/main -I/usr/include/php/20220829/TSRM -I/usr/include/php/20220829/Zend -I/usr/include/php/20220829/ext -I/usr/include/php/20220829/ext/date/lib

@mbretter
Copy link
Collaborator

mbretter commented Dec 16, 2022

update-alternatives --config php-version did the trick

now, at least for php7.4, I'm getting this error:

/bin/bash /data/www/php-radius/libtool --mode=compile cc  -I. -I/data/www/php-radius -DPHP_ATOM_INC -I/data/www/php-radius/include -I/data/www/php-radius/main -I/data/www/php-radius -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /data/www/php-radius/radlib.c -o radlib.lo 
libtool: compile:  cc -I. -I/data/www/php-radius -DPHP_ATOM_INC -I/data/www/php-radius/include -I/data/www/php-radius/main -I/data/www/php-radius -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /data/www/php-radius/radlib.c  -fPIC -DPIC -o .libs/radlib.o
/data/www/php-radius/radlib.c: In function ‘rad_auth_open’:
/data/www/php-radius/radlib.c:751:68: error: too many arguments to function ‘php_combined_lcg’
  751 |                 php_srand(time(NULL) * getpid() * (unsigned long) (php_combined_lcg(NULL) * 10000.0));
      |                                                                    ^~~~~~~~~~~~~~~~
In file included from /usr/include/php/20190902/ext/standard/php_rand.h:27,
                 from /data/www/php-radius/radlib_compat.h:42,
                 from /data/www/php-radius/radlib.c:52:
/usr/include/php/20190902/ext/standard/php_lcg.h:30:15: note: declared here
   30 | PHPAPI double php_combined_lcg(void);
      |               ^~~~~~~~~~~~~~~~
make: *** [Makefile:193: radlib.lo] Error 1

same error with php8.0 and php8.1

@Jan-E
Copy link
Contributor

Jan-E commented Dec 16, 2022

I will check in Windows what happens if we change those calls to php_combined_lcg into php_combined_lcg(void). Maybe in older PHP versions the extra arguments are really needed.

@Jan-E
Copy link
Contributor

Jan-E commented Dec 16, 2022

Even in PHP 7.0 it was php_combined_lcg(void). Looks like changing those calls is safe, but I will test it and provide another PR if compilation on Windows still succeeds.
Ref: https://github.com/php/php-src/blob/PHP-7.0/ext/standard/php_lcg.h

@Jan-E
Copy link
Contributor

Jan-E commented Dec 16, 2022

Removing the NULL in the calls to php_combined_lcg() seems the way to go:
https://github.com/alexmontoanelli/php-radius/blame/f70a9c3500dda738ded752a569b51ed52993668a/radlib.c#L751

See also this comment: #5 (comment)

@mbretter
Copy link
Collaborator

yep looks good, build is working now on 7.4, 8.1, 8.2

@mbretter
Copy link
Collaborator

tests are still failing, mainly because:
Failed opening required '/data/www/php-radius/tests/server/attribute.php'

@Jan-E
Copy link
Contributor

Jan-E commented Dec 16, 2022

@Jan-E
Copy link
Contributor

Jan-E commented Dec 16, 2022

Maybe try the attribute.php and vsa.php here: https://git-lju.6connect.com/open-source/php-radius/-/tree/php8/tests/server

@mbretter
Copy link
Collaborator

grabbed the missing file from the 1.4b branch, however one test is failing, many are skipped, though I have all the required extensions installed:

SKIP RADIUS: RFC 3576 CoA message support [tests/coa.phpt] reason: : pcntl, radius and sockets extensions required
SKIP RADIUS: RFC 3576 disconnect message support [tests/disconnect.phpt] reason: : pcntl, radius and sockets extensions required
PASS radius_acct_open() [tests/radius_acct_open.phpt] 
PASS radius_auth_open() [tests/radius_auth_open.phpt] 
FAIL radius_close() [tests/radius_close.phpt] 
PASS radius_cvt_addr() [tests/radius_cvt_addr.phpt] 
PASS radius_cvt_int() [tests/radius_cvt_int.phpt] 
PASS radius_cvt_string() [tests/radius_cvt_string.phpt] 
SKIP radius_get_attr() [tests/radius_get_attr.phpt] reason: : pcntl, radius and sockets extensions required
PASS radius_get_tagged_attr_data() [tests/radius_get_tagged_attr_data.phpt] 
PASS radius_get_tagged_attr_tag() [tests/radius_get_tagged_attr_tag.phpt] 
PASS radius_get_vendor_attr() [tests/radius_get_vendor_attr.phpt] 
SKIP radius_put_addr() [tests/radius_put_addr.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_addr() with tag [tests/radius_put_addr_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_attr() [tests/radius_put_attr.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_attr() with tag [tests/radius_put_attr_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_int() [tests/radius_put_int.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_int() with tag [tests/radius_put_int_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_string() [tests/radius_put_string.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_string() with tag [tests/radius_put_string_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_addr() [tests/radius_put_vendor_addr.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_addr() with tag [tests/radius_put_vendor_addr_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_attr() [tests/radius_put_vendor_attr.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_attr() with tag [tests/radius_put_vendor_attr_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_int() [tests/radius_put_vendor_int.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_int() with tag [tests/radius_put_vendor_int_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_string() [tests/radius_put_vendor_string.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_string() with tag [tests/radius_put_vendor_string_tag.phpt] reason: : pcntl, radius and sockets extensions required
PASS radius_request_authenticator() [tests/radius_request_authenticator.phpt] 
PASS radius_salt_encrypt_attr() [tests/radius_salt_encrypt_attr.phpt] 
PASS radius_server_secret(): load from radius_add_server() [tests/radius_server_secret.phpt] 
PASS radius_server_secret(): load from configuration file [tests/radius_server_secret_config.phpt] 

@maticomba
Copy link

maticomba commented Dec 16, 2022

I can confirm that now compiled correctly on:

# php -v
PHP 8.1.2-1ubuntu2.9 (cli) (built: Oct 19 2022 14:58:09) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.9, Copyright (c), by Zend Technologies

But I got the same errors when make test:

SKIP RADIUS: RFC 3576 CoA message support [tests/coa.phpt] reason: : pcntl, radius and sockets extensions required
SKIP RADIUS: RFC 3576 disconnect message support [tests/disconnect.phpt] reason: : pcntl, radius and sockets extensions required
PASS radius_acct_open() [tests/radius_acct_open.phpt] 
PASS radius_auth_open() [tests/radius_auth_open.phpt] 
FAIL radius_close() [tests/radius_close.phpt] 
PASS radius_cvt_addr() [tests/radius_cvt_addr.phpt] 
PASS radius_cvt_int() [tests/radius_cvt_int.phpt] 
PASS radius_cvt_string() [tests/radius_cvt_string.phpt] 
SKIP radius_get_attr() [tests/radius_get_attr.phpt] reason: : pcntl, radius and sockets extensions required
PASS radius_get_tagged_attr_data() [tests/radius_get_tagged_attr_data.phpt] 
PASS radius_get_tagged_attr_tag() [tests/radius_get_tagged_attr_tag.phpt] 
PASS radius_get_vendor_attr() [tests/radius_get_vendor_attr.phpt] 
SKIP radius_put_addr() [tests/radius_put_addr.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_addr() with tag [tests/radius_put_addr_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_attr() [tests/radius_put_attr.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_attr() with tag [tests/radius_put_attr_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_int() [tests/radius_put_int.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_int() with tag [tests/radius_put_int_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_string() [tests/radius_put_string.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_string() with tag [tests/radius_put_string_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_addr() [tests/radius_put_vendor_addr.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_addr() with tag [tests/radius_put_vendor_addr_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_attr() [tests/radius_put_vendor_attr.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_attr() with tag [tests/radius_put_vendor_attr_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_int() [tests/radius_put_vendor_int.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_int() with tag [tests/radius_put_vendor_int_tag.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_string() [tests/radius_put_vendor_string.phpt] reason: : pcntl, radius and sockets extensions required
SKIP radius_put_vendor_string() with tag [tests/radius_put_vendor_string_tag.phpt] reason: : pcntl, radius and sockets extensions required
PASS radius_request_authenticator() [tests/radius_request_authenticator.phpt] 
PASS radius_salt_encrypt_attr() [tests/radius_salt_encrypt_attr.phpt] 
PASS radius_server_secret(): load from radius_add_server() [tests/radius_server_secret.phpt] 
PASS radius_server_secret(): load from configuration file [tests/radius_server_secret_config.phpt] 

@Jan-E
Copy link
Contributor

Jan-E commented Dec 17, 2022

Are you both sure that the sockets and pcntl functions are loaded? Try editing
https://github.com/LawnGnome/php-radius/blob/master/tests/server/fake_server.php#L325
to see which one is missing.

Or try php -i | grep pcntl and php -i | grep sockets

On Windows I cannot load the pcntl extension, so a lot of tests fail if I remove extension_loaded('pcntl') in fake_server.php

@maticomba
Copy link

Yes, they are OK:


# php -i | grep sockets
/etc/php/8.1/cli/conf.d/20-sockets.ini,
sockets
# php -i | grep Sockets
Sockets Support => enabled
# php -i | grep pcntl
pcntl
pcntl support => enabled
# php -i | grep radius
radius
radius support => enabled

@Jan-E
Copy link
Contributor

Jan-E commented Dec 17, 2022

Is the sockets extension compiled statically into PHP? Or do you have to load it in your php.ini? Looks like 20-sockets.ini loads it as shared extension. If it really is a shared extension make sure that you use a php.ini in your ‘make test’ that loads it.

At least one of those checks on extension_loaded() in https://github.com/LawnGnome/php-radius/blob/master/tests/server/fake_server.php#L325 must return false and cause the SKIP. Try removing the check on sockets or pcntl.

@mbretter
Copy link
Collaborator

When running the tests, the sockets and pcntl extensions will not be loaded, it seams the testing environment is using a different php config. No idea how to fix this.
Those extensions are definitely loaded when running php from the commandline.

---- EXPECTED OUTPUT
Notice: Tag must be between 0 and 255 in %s on line %d
bool(false)

Notice: Tag must be between 0 and 255 in %s on line %d
bool(false)
bool(false)
bool(false)
bool(true)
bool(true)
int(0)
---- ACTUAL OUTPUT
Fatal error: Uncaught Error: Call to undefined function RADIUS\FakeServer\socket_create() in /data/www/php-radius/tests/server/fake_server.php:273
Stack trace:
#0 /data/www/php-radius/tests/radius_put_addr_tag.php(20): RADIUS\FakeServer\FakeServer->handle()
#1 {main}
  thrown in /data/www/php-radius/tests/server/fake_server.php on line 273
ERROR: Fake RADIUS server never signalled it was ready

Fatal error: Uncaught Error: Call to undefined function RADIUS\FakeServer\posix_kill() in /data/www/php-radius/tests/server/fake_server.php:311
Stack trace:
#0 /data/www/php-radius/tests/radius_put_addr_tag.php(20): RADIUS\FakeServer\FakeServer->handle()
#1 {main}
  thrown in /data/www/php-radius/tests/server/fake_server.php on line 311

@hitched97
Copy link
Author

I get the same results from make test as @maticomba . My system is FreeBSD 13.1, so it doesn't seem it's an OS problem. I tried with both PHP 8.1.12 and PHP 8.2.0, and had packages for php-pcntl and php-sockets installed in both cases, evidenced in php -i output. (All from FreeBSD's packages, no local builds except the php-radius checkout.) I found a tmp-php.ini that was created locally (by phpize I think), and I copied the extension=pcntl.so etc lines to it, but that did not help.

@Jan-E
Copy link
Contributor

Jan-E commented Jan 4, 2023

Try adding this to a *.phpt test script

--EXTENSIONS--
radius
sockets
pcntl

See the tests for pcntl: https://github.com/php/php-src/blob/master/ext/pcntl/tests/001.phpt
Otherwise, put a php.ini in the directory where you run 'make test' with something like:

[PHP]
output_buffering=0 
date.timezone=UTC
extension=radius
extension=sockets
extension=pcntl

@Haseebaleem
Copy link

Is any one here to solve this problem...?
My code is:
$radh = radius_auth_open()
or die ("Could not create handle");
echo "Handle successfully created";
And the Error is:
Uncaught Error: Call to undefined function radius_auth_open()
I want to call radius functions on my php project...!

@jkroonza
Copy link

jkroonza commented Jan 9, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants