I am not sure that you can put a function inside that statement (or that particular function).
But I would test the process by using this test code
$permalink = get_permalink();
$loginurl = wp_login_url($permalink);
echo "permalink is $permalink<br>";
echo "loginurl is $loginurl <br>";
Turn on error logging/display to see any errors.
And all of this is assuming that you have loaded all of the WordPress stuff to use the WP functions. Your code by itself won’t run without the WP stuff…perhaps that is your problem.
Note that the get_permalink() function will return false if a post is not ‘active’…so you will need to put your test code inside a WP ‘loop’.
The wp_login_url returns the login URL of the WP site. It will be the same for any part/post of your site, so doesn’t depend on the permalink value.
Remember that the wp_login_terminal parameter is where the user will go when they login correctly. So the 2nd line of the code above should just be
$loginurl = wp_login_url();