drupal wont open - gives a parse error - drupal

I was creating a module and had made a typo and then got a "Parse error: syntax error, unexpected '[', expecting ']' in..." error. But now when I try to go to my drupal site it gives me this error even though I fixed it! I can't get into the site at all! How do I flush this error out of drupal so that I can restart?

You knew what you have been doing last to your module, comment all last inserted code and check than if your site works. If it works add code again, also check if that code is cashed for some reasons and clear cache.

Related

Parse error , Wordpress No FTP server

I edited function.php file in wordpress. I edited this accidenlty incorrect. When i try to login in or go on wordpress page there is an error "Parse error: syntax error, unexpected ''" data-text="'' (...) "
I dont have installed plugin with ftp on wordpress, what is the solution ?how to fix it?
I know where error is, I just dont have access to fix it. I cant even log in to wp-admin.
Here is whole error :
Parse error: syntax error, unexpected ''" data-text="'' (T_CONSTANT_ENCAPSED_STRING) in /home3/dhazard/public_html/zero-below.com/wp-content/themes/credenza-wp/vc_templates/thb_share.php on line 10
I dont have code because i dont have access to this.
I tried to access via ftp but it doesn't work.
Is there any other way to access wordpress files to fix this bug in code?

MAMP PRO - No Data Recived ERR_EMPTY_RESPONSE

So I'm having an issue with a MAMP & Wordpress local install where frequently on reload I get a "No data received ERR_EMPTY_RESPONSE" page. I also get the following in the console.
/deep/ combinator is deprecated. See
https://www.chromestatus.com/features/6750456638341120 for more
details. http://localhost:8888/xxx/:1 GET
http://localhost:8888/xxx/ net::ERR_EMPTY_RESPONSE
http://localhost:8888/xxx/:1 GET http://localhost:8888/xxx/
net::ERR_CONNECTION_REFUSED
I've not been able to find anything that addresses these errors, except to restart the server. Not sure what else I need to do to trouble shoot this.
I've been getting this error constantly over the past few days. I found that if I switched themes back to the default twentyfifteen it solved the issue.
There was obviously an error somewhere in my custom theme, so I started to re-name files to find the culprit. It ended up being the functions.php file. There was this snippet of code in there:
'packages-nav' => _('Packages Nav'),
The single underscore was causing the issue.
Try a similar method on your theme to find the error. Not sure if this is any help, but I've been Googling the issue and couldn't find any solutions, so when I found a fix I wanted to share.

Unable to access/use my Drupal site after .htaccess mistake

hoping i could get some quick help on this problem.
Here is the URL for my site: www.eastwestcards.com - I accidentally used the .htaccess file generated by drupal for someother sites on my hosting and I think this is what caused this error. Could anyone tell me how to fix this? It literally happened right after i copied the drupal .htaccess file and used it on another domain that uses drupal as well. This same error occurs when i try accessing my other domain which uses drupal.
This is the error that I am reading when i try to access my site
Parse error: syntax error, unexpected T_CLASS in Parse error: syntax error, unexpected T_CLASS in /nfs/c07/h04/mnt/108263/domains/eastwestcards.com/html/includes/bootstrap.inc on line 287
Thanks in advance for any help given.
I think here you could find a answer http://drupal.org/node/1373932

finding out what is causing dreaded "The website encountered an unexpected error. Please try again later." message

while doing a drupal 6 to 7 upgrade I am getting the not so helpful message
"The website encountered an unexpected error. Please try again later." everytime I go to certain pages.
ex) /admin/config
What is the best way to find out what is causing the fatal error so that I can fix it?
All I can think of right now is to start disabling contributed modules until that page works or looking through the logs.
Thanks.
If dlog/watchdog and php error log aren't working, try this:
go on /includes/error.inc
comment line line 245
print theme('maintenance_page', array('content' => t('The website encountered an unexpected error. Please try again later.')));
and put this
print theme('maintenance_page', array('content' => t('The website encountered an unexpected error. Please try again later.'.$fatal.' '.var_export($error,true))));
Very similar, you put var_export($error,true)) at end of error
By clearing the logs at /admin/reports/dblog then reloading the broken page I easily could identify the offending module when I rechecked the log.
Site is working fine now : )
You definitely should be disabling all contrib modules to perform the upgrade.
Then enable them a few at a time after they have been replaced with the D7 version. When replacing the module, be sure to clean out the entire module directory, just in case some old files remain.
This should help narrow down the problem and be sure to check the php error log in case you find something there. (Although that is usually in the case of the White Screen Of Death.)
As gyozo mentioned if you are not able to log into the site, then it might be difficult to debug.
Then probably you could try
Log into database and run delete from watchdog;
Refresh the page
Then execute the database query select variables from watchdog;
Look out for the text near message
Am replying on 8 years old thread. But wanted to share my inputs to fix this error. I am using Drupal 8.*
I faced the same error when I tried to clear the cache (From performance). I tried several things mentioned in most of the blogs or drupal help.
In the end I came to know that, there was some YML formatting issue in my Drupal 8 theme files. I removed tabs and validated my YML files from online YML validator.
In Drupal 8.7 you can do this in core/lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php line 126:
$content = $this->t('The website encountered an error. Please try again later.' . var_dump($error));

Drupal "page not found" error keeps getting logged in Recent Log Entries

Our website keeps logging a "page not found" error under the Drupal Recent Log Entries, but we do not know where it is coming from. When clicking into the detail of the error, the location is marked as "http:///*", user is "Guest", and severity is "warning". Does anybody have ideas on where we can find out what's causing these errors to log?
Page not found warnings like this can be caused every kind of code that triggers an http request, like loading a .js or .css file or an image. A way to debug this is the quick-and-dirty method described by Lullabot which means that you add a debug_backtrace() at the point where the warning is registered (in your case probably the watchdog() function, see the comment by Randy Fay).
PS. #Arvind: If you're using the Drupal API correctly, there shouldn't be too many drupal_goto calls in your code.
do you have atypo error in your code? check if you have mistakenly commented coz i see /* in the link.
This has to be a local error. I would check for my drupal_goto calls in my code.
this is my guess and i'm no drupal expert. let us know if it helps.
atb!
You might have an issue with your favicon like I did, although I don't recalling it generating errors in my watchdog.
It's what triggered a lot of page not founds on my setup.
Basically, you normally put your favicon in your root. However, some browsers ( I believe IE6 ) , don't check the root for your favicon, but your theme folder.
I just duplicated my favicon in my theme folder, and my problem was solved.
Worth a try.

Resources