Web.Config error - web-config

i want to add DotNetNuke website functionality in NopCommerce project, so i have added DotnetNuke folders,web.config,pages(ASP.Net VB) at admin folder in Nopcommerce(Asp.net c#) project.
i have two web.configs one at in admin Folder and other is in Root
i have added DotnetNuke web.config in Root web.config of Nopcommerce
my error is
Cannot register or retrieve components until ComponentFactory.Container is set
Please review the stack trace for more information about the error and where it originated in the code.
Is my process correct.if not then please help me.

There is a lot of stuff in the NopCommerce web.config file that is needed for it to function properly. It sounds like you just replaced the NopCommerce root web.config with the DNN web.config, which is a major no-no. (I could be wrong about what you did, but that's what it sounds like?)
Judging from what you're looking for, it sounds like you might be more interested in a Virtual Folder in IIS. It will allow to separate your web applications and have separate web.config files.
Here's an MSDN article on creating Virtual Directories in IIS 7
Here's one for IIS 6.

Related

Blazer Server App - Add web.config settings

I have a Blazor Server app that is running under IIS. I see that it generates a web.config file upon publish with some settings in it.
I need to add some more settings to the web.config as they are used by another component (asp.net 4 app). Does anyone know which file I need to create/modify in order to be able to add these values.
At this stage I do not need to use transforms on the web.config, but it would be nice to know this as well.
What I found is that the web.config works as per Asp.Net Core documentation. In brief for a Blazor server app hosted under IIS (this is my understanding)
If there is no web.config existing in the root of the project directory, one is created during the build and copied to the bin directory. It will contain default information.
If a web.config exists in the root of the project directory, it is copied to the bin folder unmodified (note: it requires some default settings inside).
If transforms exist, they will be applied.
I didn't realise that the web.config is created if it did not exist hence my original question.
Also, I have not been able to get transforms to work yet.
I found that if you publish the project the web.config in the root gets ignored and uses the auto-generated one.
Adding this to my blazor project file solved it and can see the web.config getting published to Azure now:
<PropertyGroup>
<PublishIISAssets>true</PublishIISAssets>

IIS Sub Application Unable to Read Web.Config

I have a website setup in IIS that has an application within it. For whatever reason, IIS can't access the web.config of this sub application. Looking in the website directory, the config file is right where it should be.
If I try to edit (through IIS manager) any configurations of the sub application I get the following error:
The file path in the error notification is correct, except for '\\?\' appended to the beginning.
The parent website web.config has no issues, and can be configured through IIS.
What could be causing this error? Thanks in advance.
Needed to install the component IIS URL Rewrite Module 2. Once this was in place, the web.config was consumed properly.

Zend Framework Setup on Hostmonster?

I have created a project locally using Zend Framework 1.11. I have spent a long time learning the basics of the framework from all the online tutorials I can find, and I now feel fairly comfortable using the ZF Tool and locally working on my project on WAMP. I decided it was time to upload my project and deploy it on my shared hosting server, which happens to be Hostmonster.
After uploading my project, I have been struggling to get it to function correctly on the remote host. I have successfully uploaded my Zend Framework Library and included it in my PHP.ini, and all tests show it is seen by the server.
My directory structure, which was originally created to the standard format by the ZF Tool locally on the command line, is not pointing to the same paths on the remote server, so everything was messed up when I navigated to the Project/public folder. After much more Googling, I found several posts by various bloggers related to modifying .htaccess files, etc., which resulted in all my other sites hosted on the server being disrupted.
The closest I have been able to come to re-creating my initial local site on the Hostmonster host is by:
Taking all the directories out of my "public" ZF folder, and putting them directly in the web root of my server, (public_html), and:
Changing the 'APPLICATON_PATH' of my index.php file from the ZF public folder with the path to my ZF library (changed to reflect where it is in relation to the new location).
With this (tedious) setup, I am now seeing my index view being rendered with all CSS and Javascript, but I am unable to navigate to any of the other views, and the form I have displayed via a view script is likewise not showing up, only the index view is rendered.
My Zend Framework Library is located in a directory in the web root-- public_html, with the php.ini adding it to the include path.
This is becoming very frustrating as I like a lot of the features of ZF, but the restructuring of the site is proving impossible. If anyone has instructions or experience with this setup, I would greatly appreciate it. I am also hosting multiple other sites on this server, so I'm hoping I don't have to change from the single php.ini configuration(5.3) I'm currently using or mess around with a bunch of .htaccess files.
Thanks for any help anyone may have!
I have ZF running on HM no problem. Just place your index.php and .htaccess in your public_html dir, and what I did was created a public_html/zend/library folder and in my index.php including that library to get things working.
Also what do u mean you're running other sites off this server? Are you serving the application on the root of your domain? ie in your http://domain.com/ path? or different subdomains?

Zend framework deployment on the shared hosting

I want to deploy my project made in zend framework to my shared hosting.
My project has such structure:
application
docs
library
Obsolete
public
scripts
tests
This is what I have done:
I copied Zend folder (all library files) into library folder
I copied all the structure above into public_html/projects/project
(so if I type www.mydomain.com/projects/project/public I run the project
I tried to click on some link so that it redirected me to www.mydomain.com/projects/project/public/someController/someAction
Unfortunately all i see is a white, empty page.
Locally (using Zend server CE) it worked perfectly
Here it looks like Zend doesn't recognize that it should do anything with this url and redirecto to appropriate action.
What have I missed?
Greetings!
The reason you see empty page instead of errors is that error_reporting is probably off by default on your production server.
You may change the settings concerting displaying errors and exceptions in application.ini.
The other cases the errors are not displayed is something goes wrong in the view (eg. view helpers), which must return string, not the exception.
Things to check:
paths
include_path
permissions to write for files/dirs which do require this
PHP version
.htaccess setup
stating the obvious here but I'd check your apache error log.
You should check if the server is running php as a module or CGI, in the later case it will not read the SetEnv of .htaccess and you will have to set to development mode in index.php by hand, or specify your config in php.ini

Problems with setting the path for Zend framework, needed for Youtube API

I copied & pasted this text here. It seems the editor seems to format some parts randomly. ;)
I downloaded ZendGdata 1.9.6, extracted it & uploaded it to my site's
root folder ..., which I need for use with Youtube API to get videos onto my site.
I must say I’m new to all this, and so I would appreciate taking this into account.
The library folder is at /ZendGdata/library.
The problem I'm having is Step. 3 when I follow instructions
(http://code.google.com/intl/de-DE/apis/gdata/articles/php_client_lib.html#gdata-installation)
for setting it up for that purpose.
Download the Google Data Client Library files.
Decompress the downloaded files. Four sub-directories should be
created:
demos — Sample applications
documentation — Documentation for the client library files
library — The actual client library source files.
tests — Unit-test files for automated testing.
Add the location of the library folder to your PHP path (see the next section)
One of the suggested locations to add the path, apart from the .htaccess file is in php.ini.
My site is on shared hosting. I have no access to the main php.ini file, but I’m allow to create one if I need one. For Drupal CMS, for some functions, it suffices placing one in the root folder.
I added this line:
include_path=".:/usr/lib/php:/usr/local/lib/php:/home/habaris6/
public_html/site.root.folder/ZendGdata/library";
When I however go to mysite.com/ZendGdata/demos/Zend/Gdata/InstallationChecker.php to test the set up, like is mentioned in the
documentation on Youtube, I get the error:
PHP Extension ErrorsTested No errors found
Zend Framework Installation Errors: Tested 0
Exception thrown trying to access Zend/Loader.php using 'use_include_path' = true.
Make sure you include Zend Framework in your include_path which currently
contains: .:/usr/lib/php:/usr/local/lib/php
SSL Capabilities Errors: Not tested
YouTube API Connectivity Errors: Not tested
So my question is: Is that the correct way to “Add the location of the library folder to your PHP path” ?
I’m a bit mixed up.
Someone was saying the php.ini file is only active in the folder where it is located. If that is the case, which of the ZendGdata folders should have it?
As I said, my purpose is to have a the Zend framework properly set up to allow using Youtube API, something I also yet have to learn to do.
In Youtube API Google group, I was referred here. The documentation coming with the downloaded file & at zend.com pre-supposes, one knows much more than some beginners like me.
Another person said I try placing this
$clientLibraryPath = '/home/habaris6/public_html/site.root.folder/ZendGdata/library';
$oldPath = set_include_path(get_include_path() . PATH_SEPARATOR . $clientLibraryPath);
in mysite.com/ZendGdata/demos/Zend/Gdata/InstallationChecker.php
Whereas everything I had tried before failed, except fot the first test, when I placed the above snippet in the installation checker, I got positive tests for everything:
Ran PHP Installation Checker on 2009-12-09T21:16:08+00:00
PHP Extension ErrorsTested: No errors found
Zend Framework Installation Errors Tested No errors found
SSL Capabilities ErrorsTested No errors found
YouTube API Connectivity ErrorsTested No errors found
Does it mean if I place that snippet in install checker, all scripts needing the library can access it?
If not, please let me know what exactly to place in the self-made php.ini & in which folder(s) it should be.
Should that not work, and I were to use .htaccess files, what exactly, based on the folders mentioned above should be the content & exactly which folders should they be in? I read that the .htaccess files should be placed in each folder. Does it really mean I should place one in each of the ZendGdata folders?
I would be grateful for any guidance enabling me to finally start, after failing to sufficient get responses elsewhere.
Thanks in advance.
It's not necessary to put all the ZendGdata code under your website document root. In fact, as a rule I don't put PHP class libraries in a location that can be accessed directly by web requests, because if there's any way to do mischief by invoking the class files directly, then anyone can do it.
Instead, put libraries outside your document root and then reference them from scripts that are run directly. For example, you could create a directory phplib as a sister to your public_html directory. Then upload the ZendGdata bundle under that phplib directory.
You can set your PHP include path in a .htaccess file. You don't need to create a .htaccess file in every directory, because the directives in any .htaccess file apply to all files and directories under the directory where the .htaccess resides. See http://httpd.apache.org/docs/2.2/howto/htaccess.html for more information.
So I would recommend creating a .htaccess file at /home/habaris6/public_html/site.root.folder containing the following directives:
<IfModule mod_php5.c>
php_value include_path ".:/usr/local/lib/php:/home/habaris6/phplib/ZendGdata/library"
</IfModule>
See http://php.net/manual/en/configuration.changes.php for more info on this.
Note that this assumes your webhosting company allows you to use .htaccess files, and that they allow you to use the php_value directive in .htaccess files. Enabling these options is an Apache configuration and they could have their own policies against that for reasons of performance or security. You should contact them for this answer; no one on the internet can answer questions about your hosting provider's policies.
If you choose to use the set_include_path() PHP function to append a directory to your runtime include path, you need to do this in each file that serves as a landing point for a web request. That is, if you permit a request to be made directly to foo.php then you need to add the code to foo.php. Any files or classes subsequently included by foo.php use the include path you defined.
Note also that whatever method you use to define the include path, it has to take effect before your script tries to load any PHP class files via the include path. The .htaccess method should accomplish this, and if you use the code method you just have to put the code high enough in your PHP script.
I don't use the method of creating a custom php.ini file under each directory within your site document tree. That's a new feature of PHP 5.3.0, not supported by earlier versions of PHP. If you're using Apache you should just use .htaccess for the same effect.