Github Codespace CraftCMS Headers sent error - github

I am trying to setup a Github Codespace env with PHP and MySQL to run CraftCMS 4. Everything works fine from PHP/MySQL side and I was also able to install all CraftCMS dependencies using composer and could run craft setup from console.
The only issue I have is that as soon as I run the Built-in-PHP Webserver or Apache server and try to access Craft CMS through localhost I get a errors saying headers already sent.
[web.ERROR] [yii\base\ErrorException:2] session_name(): Session name cannot be changed after headers have already been sent
This only happens if I try to access /craft/web... if I access another php file within the project it shows without issues.
So it seems like something CraftCMS specific maybe. Any ideas on what could cause this behaviour?

Related

How to fix 401 Unauthorized Private Github Package

I am trying to install a private Github package to a Gatsby project I'm working on that will get deployed to Netlify, but I am continuing to get a 401 Unauthorized...
When I add my token inline, or use my ~/.npmrc file it works and installs fine but doesn't work when I am using a local environment variable.
Here is my .npmrc file...
//npm.pkg.github.com/:_authToken=$NPM_TOKEN
#OWNER:registry=https://npm.pkg.github.com/OWNER
NOTE
I have also tried this with no luck -
//npm.pkg.github.com/:_authToken=${NPM_TOKEN}
#OWNER:registry=https://npm.pkg.github.com/OWNER
How do I get my environment variable to work inside my local project .npmrc file?
UPDATE
I managed to get it working locally by removing the extra the last / from github.com (shown below), but this still doesn't fix the error on the Netlify side.
- //npm.pkg.github.com/:_authToken=$NPM_TOKEN
+ //npm.pkg.github.com:_authToken=$NPM_TOKEN
Any help would be appreciated, thanks.
I got it working but I'm sure there's a better way...
The .npmrc has to be
To get it working locally -
//npm.pkg.github.com:_authToken=$READ_TOKEN
#OWNER:registry=https://npm.pkg.github.com/OWNER
However this returns a 401 unauthorised error on Netlify...
To Get it to work on Netlify -
//npm.pkg.github.com/:_authToken=${READ_TOKEN}
registry=https://npm.pkg.github.com/OWNER
However like-wise this doesn't work locally...
At the moment I'm having to switch them out manually depending on whether I'm working locally or using it in production but as I say I think there must be a better way to do that.

Nuget Server issue post migration to Win 2016

I have migrated nuget repository from Win 2008 to Win 2016.
Alias to that server: http://xyz.mycompany.com/NugetFeed
Apart of windows, IIS is different as well, on the new server it is IIS 10.
After migration, nuget works pretty well, except one function. I can browse packages via web (http://xyz.mycompany.com/NugetFeed) or via Visual Studio etc. Visual Studio can see packages created manually.
The only problem is with the nuget push.
>nuget push FEDivaNET.dll*.nupkg -Source http://xyz.mycompany.com/NugetFeed/ D568CD48-1609-40C9-9A5D-7ADC808129E5
Pushing FEDivaNET.dll.3.41.73.nupkg to 'http://xyz.mycompany.com/NugetFeed/'...
PUT http://xyz.mycompany.com/NugetFeed/
NotFound http://xyz.mycompany.com/NugetFeed/ 128ms
Response status code does not indicate success: 404 (Not Found).
System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at NuGet.Protocol.Core.Types.PackageUpdateResource.<>c.<PushPackageToServer>b__23_0(HttpResponseMessage response)
at NuGet.Protocol.HttpSource.<ProcessResponseAsync>d__181.MoveNext()
It is not a problem with the URL. When you try to modify URL then you will get different error
It is not a problem with permissions to D:\MyServer\NugetPackages on server, as I have set full permissions to that folder. I have also moved packages folder to different locations (ie. some other external network drive), but I am having same issue.
I tried compiling 2 different Nuget.Server versions: 2.14.0 and 3.1.2 ...Same exception.
Inside IIS, I am pretty sure I have set same settings as on the old server. Also I have INTEGRATED pipeline mode, so everything is good. I also tried setting authentication via technical users etc.
Not sure where is the issue, I think I checked every single setting. I tried with APIKEY, and without APIKEY. I modified every single setting in the Web.config, no luckā€¦..
The url on which push the nuget packet is something like
http://{server}/{feed}/api/v2/package
So in your command use:
nuget push FEDivaNET.dll*.nupkg -Source http://xyz.mycompany.com/NugetFeed/api/v2/package
Documentation : Publish a package
When you create website in IIS 10, then by default PUT verb is not allowed.
This can be set here:
IIS -> YOUR WebSite -> Request Filtering -> HTTP Verb tab: **Set PUT verb**
This has fixed an issue.

Connection timeout when getting plugin list or updating Eclipse PDT

I'm working on win 7 and trying to get Zend Eclipse to run properly for a CakePHP project. But when try to access the plugin list via the welcome page I get this error:
A problem occurred while accessing the update site.
RemoteBundleDiscoveryStrategy failed with an error
Unable to read repository at http://downloads.zend.com/studio-eclipse/updates-extra/10_0/pdt_directory.xml.
Connect timed out
I've tried severalt solutions I found on the net but nothing worked. My proxy settings are fine since I can access all sites via the internal browser of eclipse. My guess is, that there is some restriction in the Windows administration that is keeping me from getting the plugin list.
When I try to update Eclipse the update window tries half an hour to contact the software site and after that I get this error message:
Some sites could not be found. See the error log for more detail.
Communication with repository at http://downloads.zend.com/studio-eclipse/updates/10_0 failed.
Connect timed out
Finally!!
The problem was that is were actually two problems. First one was that Eclipse wasn't saving the username and password for the proxy settings. After finally finding the eclipse error log in
"{eclipse-workspace}/.metadata/.log"
(there seems to be no way to view the file in zend-eclipse itself) I found out that Eclipse was trying to save the password-file into the Administrator's user directory but had no access. (Oh what a surprise)
Putting this into the "zend-eclipse-php.ini" worked for me:
-eclipse.keyring C:\eclipse\keyring.txt
After this was done I could finally save username and password for the proxy but still no connection. When I took another look into the error log I found this error:
"!MESSAGE System property http.proxyHost is not set but should be {proxyname}
!MESSAGE System property http.proxyPort is not set but should be {proxyport}"
and 4 more for https and socks. After googling this error I came upon a fixed bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=281472
where it states that maybe the proxy refuses SOCKS. So I cleared the settings for SOCKS and tried again and IT WORKED! Finally!
Hope this description can anyone else with these problems.

symfony2 locale and deployment

I am in the proces of creating a web application in symfony2. I have done all the development locally(OSX), but now I want to show a first version in a presentation where I can not use my own laptop.
I am deploying to an ubuntu 10 server. I also tested it on another small ubuntu 11 vps, but got the same problems.
I double checked with this tutorial whether php is set up correctly for symfony on my ubuntu server:
http://www.joelverhagen.com/blog/2011/05/how-to-configure-symfony-2-0-on-ubuntu-server-2011-4/
For deployment I followed these steps:
Moving app to production mode in Symfony 2
However the first step ( php app/console cache:clear --env=prod --no-debug ) gives me following error (this error also occurs when running this command locally):
php app/console cache:clear --env=prod --no-debug
Clearing the cache for the prod environment with debug false
[ReflectionException]
Class Packed\Bundle\UserBundle\Entity\Rapport does not exist
cache:clear [--no-warmup] [--no-optional-warmers]
Which is a bit weird since Packed\Bundle\UserBundle\Entity\Rapport does not exist, Packed\Bundle\ScoreModelBundle\Entity\Rapport however does.
since the app doe not need to go into production for some time this is not very urgent, what is very urgent is to get it running in development mode, so I tried using it through app_dev.php.
If I remove the localhost-check in app_dev.php everything works as expected but the i8n is not working... I can not switch to other locales as was possible locally:
xxx.com/app_dev.php/en
And it does not use the messages.nl.yml, messages.en.yml, ... and other files.
Any idea what might be causing this?
I checked the symfony and apache log but nothing weird there. Any other logs I should check?
Thanks!
Joris
Try to rebuild your bootstrap file. If you're using APC-cache restart it from cli. If it doesn't help.
Easiest way to do it is run composer and do the update.
To check the translations (the templates should be cached on the server) check the config.yml translator service must be enabled there. You may have it enabled in config_dev.yml but not in the config_prod.yml

Subclipse and Eclipse - RA layer request failed

I'm following the instructions for installing Ardor3D as an Eclipse Project Set via Subclipse; instructions at:
http://www.ardor3d.com/wiki/svneclipsetutorial
I installed Subclipse from
http://subclipse.tigris.org/
and installed fine. If I go to Eclipse's Preferences and Team|SVN I can see that the SVN Interface Client is JavaHL, and hence installed fine.
However, when I come to checkout the code at:
http://ardorlabs.svn.cvsdude.com/Ardor3Dv1
by selecting New|Other|SVN|Check Projects from SVN I get the following error message:
RA layer request failed
svn: Unable to connect to a repository at URL 'http://ardorlabs.svn.cvsdude.com/Ardor3Dv1'
svn: OPTIONS of 'http://ardorlabs.svn.cvsdude.com/Ardor3Dv1': could not connect to server (http://ardorlabs.svn.cvsdude.com)
I know the URL is valid as I can install the above fine on my work m/c of WinXP. However, the same installation on my personal laptop of Win7 fails to connect.
I tried temporarily disabling the firewall and it still fails.
I've tried playing around with the config and server files in:
C:\Documents and Settings\Administrator\Application Data\Subversion
but to be honest not 100% sure as what to change, if anything as I'm not using proxy settings.
If there's an expert out there who's knows the solution to this problem I would greatly appreciate hearing from you.
Thanks
Graham
PS. I find the error message "RA layer request failed" confusing as the URL is valid.
I had exactly the same problem, which turned out to be caused by a proxy server. The solution to my problem was to configure subversion to work with the proxy server, however it was not obvious how to do this.
You should have a directory similar to : C:\Documents and Settings\UserName\Application Data\Subversion
In that directory there will be a file called servers.
I un-commented and edited the following entries and my subversion is now working fine with Eclipse:
http-proxy-host
http-proxy-port
http-proxy-username
http-proxy-password
Why exactly you can't configure this through Eclipse is abit of a mystery, but there you go.
Another user account could login, I got the error as described above. The difference was the Proxy setting which was missing in my account. It is stored per user in the Registry and I could easily change this in the Tortoise SVN config.
We encountered this error with our server. While we were able to successfully access the CollabNet 5 SVN admin console, navigating to the repository to browse it from the admin console would fail. We also were not able to connect from Subclipse clients.
The problem turned out we were not hitting the correct port on the server. We had reconfigured the default port from 80 to 4343 and the admin console reported the changed setting but the server was still running on 80.
For what it's worth, in order for the configuration change to stick, we had to bring the repo server down and make the change in the admin console and then restart the machine. We were then able to browse the repo from the link in the admin console.