Problem/Motivation
New installation v. 8.1.5 in subfolder: Configuration -> System -> Basic site settings
Basic site setting page doesn't load due to error page.
Uncaught PHP Exception InvalidArgumentException: "Source path has to start with a slash." at /home/nrman99c/public_html/site/core/lib/Drupal/Core/Path/AliasManager.php line 186
Comments
Comment #2
cilefen commentedWe cannot know what the error is unless you check your PHP logs and paste the error in the issue summary.
Comment #3
drupert55 commentedHere is the error statement in php_errorlog file...
Uncaught PHP Exception InvalidArgumentException: "Source path has to start with a slash." at /home/nrman99c/public_html/site/core/lib/Drupal/Core/Path/AliasManager.php line 186
Thanks for your reply.
Comment #4
cilefen commentedIt seems like something is wrong with rewriting. What is the web server?
Comment #5
drupert55 commentedChanging status from Postponed to Active since requested info was submitted moments ago in last reply. Thanks!
Comment #6
drupert55 commentedOops - look like we posted nearly at the same time.
Linux server
Comment #7
cilefen commentedBy web server, I meant Apache, Nginx, PHP built-in, lighttpd, etc...
Comment #8
drupert55 commentedI meant to say Apache webserver, Linux operating system.
Thanks!
Comment #9
cilefen commentedDouble check the web server requirements because they touch on htaccess.
Comment #10
drupert55 commentedI will and will update you. Thanks!
Comment #11
drupert55 commentedIs this the same issue? https://www.drupal.org/node/2569117
Thanks.
Comment #12
cilefen commentedIt is at least related. We need more information in the issue summary about how this site was installed, what exactly you mean by "subfolder" (is that where Drupal is installed or are you referring to a URL path?), etc. Notice that I've used the issue summary template to make this more clear for contributors. Step-by-step reproduction instructions in the Problem/Motivation section would be quite useful.
I am marking this a Major bug because of the exception.
Comment #13
drupert55 commentedThanks cilefen.
The installation is in its own folder, which I call the 'subfolder'. It was auto-installed via Softaculous.
So far, there are 2 issues (not sure if related):
1) Described at https://www.drupal.org/node/2763925 => Upon installation, the first encounter is with the frontpage which shows Page Not Found, not the Welcome message.
This error is in the logs: PHP Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /home/.../public_html/folder/index.php on line 11
2) The next error encountered was 'Configuration -> Basic site setting', hence this submitted issue. I was clicking around to make sure all was fine with the site.
Thanks!
Comment #14
cilefen commentedThat's good, and I will stress again that it is important to update the issue summary with the things you are writing as not everyone reads all comments. Error #1 suggests you are running an old version of PHP. What version is it?
Comment #15
drupert55 commentedGotcha! PHP 5.6.18
Maybe that's an old message before the PHP version was updated. I haven't seen that message recently upon loading the page.
What I'm going to do is uninstall then reinstall again via Softaculous with PHP 5.6.18. I'll report back.
Thanks!
Comment #16
drupert55 commentedAfter reinstallation via Softaculous on Linux, Apache & PHP 5.6.18, installed in its own folder, here are the errors in php_errorlog:
~~~~~~~~~~~~
1) PHP Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /home/.../public_html/folder/index.php on line 11
2) [11-Jul-2016 22:47:25 UTC] Uncaught PHP Exception InvalidArgumentException: "Source path has to start with a slash." at /home/.../public_html/folder/core/lib/Drupal/Core/Path/AliasManager.php line 186
~~~~~~~~~~~~
Note: 1) was received upon installation and not yet visited website. There was no error message generated upon loading the front page (index file).
2) was received after clicking the 'Basic site setting' link. What displayed upon clicking was "The website encountered an unexpected error. Please try again later." in addition to the error message in php_errorlog mentioned above.
Conclusion: Issues unresolved.
Thanks!
Comment #17
cilefen commentedLine 11 of index.php contains a "use" statement, which was introduced in PHP 5.3. The PHP on your server does not understand it. This is actually the very first line of code in Drupal 8, so it's not off to a good start.
Did you actually complete an installation?
Comment #18
drupert55 commentedThanks again for your reply, cliefen!
My response (#16) is after reinstallation.
Comment #19
drupert55 commentedPROBLEM SOLVED!
In Softaculous, in the Site Name, I had special characters [The], ' and !. I'm not sure which characters caused the issue so I removed them all. That removed both errors and no php_errorlog file was created!
Wow...how I wished there were better instructions on Softaculous! Those instructions aren't even in 'Configuration -> Basic site setting' so I tried it. It took the change! Yaaay!
*** CONCLUSION: No special characters in Softaculous in Site Name. Can add AFTER the installation via 'Configuration...'***
Thanks Cilefen! We now know the info for future Softaculous installations!
Feel free to close this issue.
Thanks again!
Comment #20
cilefen commentedI guess that must have also been the directory name.
Comment #21
drupert55 commentedThe directory name was 4 alphabetical characters. It was only the Site Name that had special characters. Thanks again!
Comment #22
haseebjamal commentedHi
I have the same issue, i had special characters in drupal site title and currently my "Site Information" admin page is showing blank with the error "The website encountered an unexpected error. Please try again later."
Can you tell me what steps you took to change the site title, as the Site Info page in admin area is in-accessible.
Comment #23
cilefen commentedYou are on Softaculous?
Comment #24
haseebjamal commentedNo i migrated from D7 to D8 using "backup and migrate" module
Comment #25
cilefen commentedComment #26
cilefen commentedI'm not even sure about the sub directory involvement. It would be great to have steps to reproduce on a clean site written out in the issue summary.
Comment #28
xjmPostponing for more info for #26. Thank you for reporting this!
Comment #29
ml1 commentedUsing a port number seems to make it happen every time.
http://www.xyz.com:80/anything
Our vulnerability scanner generated thousands of these errors.
[27-Mar-2017 12:45:23 Europe/Berlin] Uncaught PHP Exception InvalidArgumentException: "Source path :80/mysql/sqlmanager has to start with a slash." at C:\Apache24\html\core\lib\Drupal\Core\Path\AliasManager.php line 186
[27-Mar-2017 12:45:24 Europe/Berlin] Uncaught PHP Exception InvalidArgumentException: "Source path :80/mysql/mysqlmanager has to start with a slash." at C:\Apache24\html\core\lib\Drupal\Core\Path\AliasManager.php line 186
[27-Mar-2017 12:45:26 Europe/Berlin] Uncaught PHP Exception InvalidArgumentException: "Source path :80/phpMyadmin has to start with a slash." at C:\Apache24\html\core\lib\Drupal\Core\Path\AliasManager.php line 186
[27-Mar-2017 12:45:27 Europe/Berlin] Uncaught PHP Exception InvalidArgumentException: "Source path :80/phpMyAdmin has to start with a slash." at C:\Apache24\html\core\lib\Drupal\Core\Path\AliasManager.php line 186
Comment #30
xjmSo #29 does not seem like a major bug to me; technically those should probably be 403s, but they are not valid paths to begin with. I believe we dealt with something similar previously a few times, once at least in D8 and once even in D7. I couldn't find the issue quickly.
Comment #31
xjmAlso, interestingly, I cannot reproduce #29. My local install runs on port 8888 and I do not get these errors using that port. I just get a normal 404 served by Drupal.
I notice Windows paths above, but #3 did not have Windows paths, so that doesn't seem to be in common either.
So I guess we still need more steps to reproduce here.
Comment #32
xjmI also was not able to reproduce any error with the site name
' ! [, either at valid or invalid URLs.It seems like there is a good chance this is a server configuration issue.
Comment #37
pameeela commentedThanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.
As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)".
Upon investigation, this seems like a duplicate of #3043779: "Source path has to start with a slash" exception when hitting path prefixed with index.php with RequestPath condition so I am going to mark this Closed (duplicate). I've also updated that issue to give drupert55 credit for contributions to this issue.
If anyone can provide additional information on how this is different, please include complete steps to reproduce the issue (starting from "Install Drupal core"), document those steps in the issue summary and set the issue status back to "Active".
Thanks!
Comment #38
pameeela commentedAnd now to actually close it!