shared-hosting interview questions
Top shared-hosting frequently asked interview questions
How do I resolve the problem of losing a session after a redirect in PHP?
Recently, I encountered a very common problem of losing session after redirect. And after searching through this website I can still find no solution (although this came the closest). But now that I have, I thought I'd post an answer here to help anyone experiencing the same problem.
Source: (StackOverflow)
I'm using blogger.com to host some texts on programming, and I'd like to use prettify (same as stackoverflow) to nicely colour the code samples.
How do I install the prettify scripts into the blog domain?
Would it be better (if indeed its possible) to link to a shared copy somewhere?
I have webspace on a different domain. Would that help?
Many thanks.
Source: (StackOverflow)
First thing: I searched all of the known web hosting companies for shared hosting of nodejs but I didn't find anyone. Then I came to know that nodejs cannot run on a shared host system. I want to know why?
Second thing: I am a normal guy with a normal budget. Choosing a vps or deicated server or cloud hosting makes the node run, but its out of my pocket money range as compared to the PHP shared hosting services, so should I learn node.js?
Source: (StackOverflow)
I started exploring CouchDB and I am interested in following:
- Is there or will there be a Windows install?
- If there is, is there a shared hosting provider that offers CouchDB?
- Not knowing much about it, can it be somehow embedded in my application or bin deployed (don't laugh).
Source: (StackOverflow)
I'm trying to use get_browser() , unfortunately my page is on a shared host, and I have no access to php.ini.
I have downloaded the latest version of browscap.ini and placed in my document root. I have then added the following:-
if (!ini_set('browscap', '/home/private stuff/browscap.ini')) {
echo "Failed to set browscap";
} else {
echo "browscap = [" . ini_get('browscap') . "]";
}
exit();
But this fails, (nb: the echo statement for the failed condition always shows [] - even if I didn;t have the browscap.ini file the setting should still show up in the ini_get.... shouldn't it?)
I have looked at the previous questions on this and they don't seem to help, any ideas?
Source: (StackOverflow)
I lost exactly 24 hours on some stupid connection string error and I can't find any solution.
I saw that there are few questions like this and I try them all but can't find solution.
I uploaded my site on godaddy shared host.
I can access this database from my management studio.
I can't access this database from my site. I get following error:
Format of the initialization string does not
conform to specification starting at index 0
My connection string is in web.config and it looks like this:
<connectionStrings>
<add name="mcn" connectionString="Data Source=mydatabase.db.8706856.hostedresource.com; Initial Catalog=mydatabase; User ID=username; Password=xyz;" providerName="System.Data.SqlClient" />
</connectionStrings>
What cause this error? I have no idea what to try anymore :(
I have also tried to write ...Data Source=(local);...
Source: (StackOverflow)
I have a cheap shared hosting plan with Reliablesite.net ($5/month).
I've been making a small site I want to start promoting in a few weeks and I was going to roadtest it by hosting it with the shared plan I already have.
My issue is that I don't know at what point I should move onto clustered hosting / dedicated hosting.
Questions
- What pageviews / day can a
shared hosting plan be expected to
handle?
-
What can standard
shared database servers take without
choking up or me getting rude emails
from my hosting provider?
Source: (StackOverflow)
I know Hostmonster allows Python. Has anyone successfully run Django on there? Any problems?
Source: (StackOverflow)
I need to deploy a laravel 5 project to a client host.
The plan of my client is basic hosting: Linux + MySql without cpanel or similar (i.e. no admin panel).
I have access only via ftp and only to a folder named www.mycustomerweb.com. It means I can not create a directory at the same level of www.mycustomerweb.com folder. Only inside it (I think it is called shared hosting).
One year ago, I deployed a project made with Laravel 4 this way:
- got rid of public folder moving its content to root folder and updating index.php and bootstrap.php
- finished whole project in localhost (with Xampp)
- uploaded all files to www.myclientweb.com via ftp.
My questions are:
Did I do everything all right with laravel 4 project? May I have fallen into security issues (I mean, is the site safe)?
How do I deploy a laravel 5 project to the same site? In Laravel 5 I can not get rid of public folder as I did with Laravel 4.
Right now, I have set up a fresh installation of Laravel 5 on localhost and then I have uploaded all files to www.myclientweb.com folder via ftp:
Surely this is not the right way...
I've had a long searching through the web and Stackoverflow with no luck.
Really apprecite any help.
Thanks for reading.
Source: (StackOverflow)
Just putting in context to clarify the main question:
On my development machine, PHP5.3.1 is installed on Apache as a module, I use SetEnv APPLICATION_ENVIRONMENT development in my application's root .htaccess file. It is then easily retrievable from any php script with getenv('APPLICATION_ENVIRONMENT').
On the production server, on a sharedhost (dreamhost), I compiled myself php5.3.1 since it was not directly supported. Everything works fine except that getenv('APPLICATION_ENVIRONMENT') returns false.
In the sharedhost root .htaccess for my domain, I use this .htaccess file
Options +ExecCGI
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi
<FilesMatch "^php5?\.(ini|cgi)$">
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUS
</FilesMatch>
Options -indexes
php5.cgi resides in /cgi-bin and works very well.
Of course in my application's root folder I have another .htaccess defining:
SetEnv APPLICATION_ENVIRONMENT production
But when using getenv('APPLICATION_ENVIRONMENT') it returns false, any idea how to resolve this?
Source: (StackOverflow)
Newbie to Fossil (or any other version control system) here. Used a proprietary one earlier, but never set one up myself.
Currently, I am looking to set one up so that my friends and I can use it for a project.
I chose Fossil primarily because distributed seems to be the way to go, it seems lightweight and has an included bugtracker. But Git seems to be the favoured SCM for a lot of people. Is it worth the added complexity to favour Git+someBugTracker over Fossil? Are there any better alternatives? I will have to start from 0 on all.
Source: (StackOverflow)
I want to access my symfony app in production env (http://www.sample.com/amateur1/web/app.php) from this url http://www.sample.com/amateur1.
To do that I moved the .htacces file to http://www.sample.com/amateur1/.htaccess with this contents:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /web/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
But when I go to http://www.sample.com/amateur1 shows a 404 Error, and prod.log isn't written.
I also used RewriteBase /amateur1/web/
because I don't know If RewriteBase path is relative to the DocumentRoot of the server, Or from the path where the .htaccess file is located. Also tried /amateur1
and /amateur1/
as RewriteBase due to this answer Symfony2: How to deploy in subdirectory (Apache)
With the three try's, The Exceptions page appears unstyled, and not loading any image. But then I get the following error in prod.log file:
[2013-02-15 02:06:47] request.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /amateur1/" (uncaught exception) at /home/u105859802/public_html/amateur1/app/cache/prod/classes.php line 5121 [] []
What I'm doing wrong ?
Source: (StackOverflow)
I am currently setting up a website from a client on his hosting account. The website address and for some reason doesn't default to .php files (that is: index.php). If I put index.php and there is no index.html file I receive the following error:
If you feel you have reached this page in error, please contact the
web site owner: someemail@example.com If you are the web site owner,
it is possible you have reached this page because: The IP address has
changed. There has been a server misconfiguration. The site may have
been moved to a different server. If you are the owner of this website
and were not expecting to see this page, please contact your hosting
provider.
His hosting is a shared hosting on cpanel.
Source: (StackOverflow)
Like a lot of others I'm receiving the following error when deploying my ASP.Net MVC application:
Cannot load V8 interface assembly; verify that the following files are installed with your application: ClearScriptV8-32.dll, ClearScriptV8-64.dll, v8-ia32.dll, v8-x64.dll
Clearscript was installed as part of an effort to transform less files on the fly for page requests.
I have tested my application locally in ISS Express and ISS without a hitch.
As suggested here http://clearscript3.rssing.com/chan-14849437/all_p12.html I've also included the missing code libraries as resources to my project.
ClearScriptV8-32.dll
, ClearScriptV8-64.dll
, v8-ia32.dll
, v8-x64.dll
are all included in a folder ClearScript.V8 in the bin folder. Removing this folder does not resolve the issue.
At my wits end. Any help is appreciated.
Source: (StackOverflow)
I have a website in an IIS 7 shared hosting environment. It's running .NET 3.5. I have a download button to download a file from the server.
When I locally deploy this application to IIS 6, it runs fine. On the IIS 7 shared hosting server, the exception occurs.
The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
System.Runtime.InteropServices.COMException: The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))
COMException (0x80070006): The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))] [HttpException (0x80004005): An error occurred while communicating with the remote host. The error code is 0x80070006.]
How can this be solved?
string strRequest = Convert.ToString(Request.QueryString.Get("file"));
System.IO.FileInfo file = new System.IO.FileInfo(strRequest);
if (file.Exists)
{
Response.Clear();
Response.ContentType = ReturnExtension(System.IO.Path.GetExtension(file.Name));
Response.AppendHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.TransmitFile(strRequest);
Response.End();
HttpContext.Current.ApplicationInstance.CompleteRequest();
//DownloadFile(file.FullName, file.Name);
}
Source: (StackOverflow)