Welcome! Log In Create A New Profile

Advanced

[PHP] pass-by-reference Error (old server)

Posted by Michelle Konzack 
Michelle Konzack
[PHP] pass-by-reference Error (old server)
December 13, 2016 05:41AM
Hello *,

I have updated an old Debian/Squeezy server and now I get an PHP error
message and my website does not more work:

PHP Fatal error: Call-time pass-by-reference has been removed in
/srv/..../includes/00_main.inc on line 252

The offending lines are:

249: if ( $_POST['admin'] == 'admin' ) {
250:
251: function do_auth() {
252: if (pam_auth($_POST['user'], $_POST['pass'], &$PAM_ERR)) {
253: $TIME=time() + 900;

OK, it is the part with "&$PAM_ERR" and I do not know, how to solv this.

Any suggestions?

Thanks in avance

--
Michelle Konzack ITSystems
GNU/Linux Developer 0033-6-61925193

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Shaun Morrow
Re: [PHP] pass-by-reference Error (old server)
December 13, 2016 05:41AM
252: if (pam_auth($_POST['user'], $_POST['pass'], &$PAM_ERR)) {

Should become:

252: if (pam_auth($_POST['user'], $_POST['pass'], $PAM_ERR)) {

Looks like its pam_auth is a PHP extension, don't know much about it, found
the source code (http://svn.php.net/viewvc/pecl/pam/trunk/) and it looks
like the 3rd parameter is pass by reference.

I would hazard a guess and say, remove the ampersand from line 252 and it
will work.

Shaun

On Tue, Jul 12, 2016 at 4:05 PM, Michelle Konzack <[email protected]>
wrote:

> Hello *,
>
> I have updated an old Debian/Squeezy server and now I get an PHP error
> message and my website does not more work:
>
> PHP Fatal error: Call-time pass-by-reference has been removed in
> /srv/..../includes/00_main.inc on line 252
>
> The offending lines are:
>
> 249: if ( $_POST['admin'] == 'admin' ) {
> 250:
> 251: function do_auth() {
> 252: if (pam_auth($_POST['user'], $_POST['pass'], &$PAM_ERR)) {
> 253: $TIME=time() + 900;
>
> OK, it is the part with "&$PAM_ERR" and I do not know, how to solv this.
>
> Any suggestions?
>
> Thanks in avance
>
> --
> Michelle Konzack ITSystems
> GNU/Linux Developer 0033-6-61925193
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Christoph Becker
Re: [PHP] pass-by-reference Error (old server)
December 13, 2016 05:41AM
On 12.07.2016 at 16:28, Shaun Morrow wrote:

> 252: if (pam_auth($_POST['user'], $_POST['pass'], &$PAM_ERR)) {
>
> Should become:
>
> 252: if (pam_auth($_POST['user'], $_POST['pass'], $PAM_ERR)) {
>
> Looks like its pam_auth is a PHP extension, don't know much about it, found
> the source code (http://svn.php.net/viewvc/pecl/pam/trunk/) and it looks
> like the 3rd parameter is pass by reference.
>
> I would hazard a guess and say, remove the ampersand from line 252 and it
> will work.

Yes, that is supposed to work. See also the note in
http://php.net/manual/en/language.references.pass.php, and the
relevant migration guides on http://php.net/manual/en/appendices.php.

--
Christoph M. Becker


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sorry, only registered users may post in this forum.

Click here to login