No Code Attached Yet bug
avatar brianteeman
brianteeman
20 Oct 2023

Steps to reproduce the issue

I couldnt find any docs so I am going by the instructions in the original pr

After installing joomla I then try to use the cli to create the public_folder

$ php cli/joomla.php site:create-public-folder

Create a public folder
======================

 Please enter the absolute path to the public folder:
 > /home/xxxxxxxxxxn/xxx.com/testcreatepublicfolder


In PublicFolderGeneratorHelper.php line 199:
                                                          
  Call to undefined function Joomla\CMS\Helper\symlink()  
                                                          

a folder /home/xxxxxxxxxxn/xxx.com/testcreatepublicfolder is created. it has two empty folders in it

/home/xxxxxxxxxxn/xxx.com/testcreatepublicfolder/administrator
/home/xxxxxxxxxxn/xxx.com/testcreatepublicfolder/api

System information (as much as possible)

php81

Additional comments

avatar brianteeman brianteeman - open - 20 Oct 2023
avatar joomla-cms-bot joomla-cms-bot - change - 20 Oct 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Oct 2023
avatar Fedik
Fedik - comment - 20 Oct 2023

Simlink function is disabled on your server.

I think the CLI script should check availability of it, it may be disabled on many other servers.

avatar Fedik Fedik - change - 20 Oct 2023
Labels Added: bug
avatar Fedik Fedik - labeled - 20 Oct 2023
avatar brianteeman
brianteeman - comment - 20 Oct 2023

Good catch
image

I tried on three servers with different providers and I see now it is disabed on all of them

avatar brianteeman
brianteeman - comment - 20 Oct 2023

and on the windows machine nothing is disabled and it still fails

avatar richard67
richard67 - comment - 20 Oct 2023

Because on Windows symlinks are different and the symlink method only works on Unixoids?

avatar richard67
richard67 - comment - 20 Oct 2023

https://www.php.net/manual/en/function.symlink.php .. should work on Windows, too, I just see.

avatar richard67
richard67 - comment - 20 Oct 2023

Hmm, a comment there says:

Symlinks on windows are created by Symlink() which accept only absolute paths but not relative paths .relative paths on windows are not supported for symlinks

avatar dgrammatiko
dgrammatiko - comment - 22 Oct 2023

Symlinks on windows are created by Symlink() which accept only absolute paths but not relative paths

@richard67 the code is already converting the (possible) relative paths to absolute:

$fullDestinationPath = JPATH_ROOT . '/' . $destinationPath;

Maybe there's a need to use DIRECTORY_SEPERATOR instead of /, but not on windows so can't really test it

avatar Hackwar
Hackwar - comment - 24 Jan 2024

Windows requires admin privileges to create the symlink.

avatar brianteeman
brianteeman - comment - 24 Jan 2024

Windows requires admin privileges to create the symlink.

Maybe it does but it still doesnt work on linux.

Call to undefined function Joomla\CMS\Helper\symlink()

The actual problem is that symlink is disabled in php on the server and as of php 8.0 the error message does not indicate that the function is disabled but says it is undefined
Reference php watch

As @Fedik says

Simlink function is disabled on your server.

I think the CLI script should check availability of it, it may be disabled on many other servers.

avatar brianteeman brianteeman - close - 24 Jan 2024
avatar brianteeman
brianteeman - comment - 24 Jan 2024

See #42705

avatar brianteeman brianteeman - change - 24 Jan 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-01-24 09:42:47
Closed_By brianteeman

Add a Comment

Login with GitHub to post a comment