Flex (with Zend) running on a IIS-Server - php

I have a Flex-Page which connects to a MySQL-DB through PHP (Zend). I run the Flex-Page on an IIS-Server (Windows Server 2008 R2) and it works. But the problem is, that i specified the web root to the C:\inetpub\wwwroot directory (there php is running). On the server i want it on another directory. (Now i have the main Flex Page in the directory für the webserver, and the php files are in the wwwroot directory).
When i specify the web root to an other directory, nothing works, not even on my local machine.
I hope you know what my problem is.. ^^ (sorry for my bad english)
Thanks in advance!

You'll need to set up a virtual directory on IIS if you want your files served from other than the web root. So google "IIS virtual directory add".

Related

How to run PHP files on XAMMP on A Mac

I have saved a PHP file to my Applications/XAMMP/htdocs directory and I want to run it in a browser.
I have used all sorts of url combinations including:
http://localhost/xammp/htdocs/HelloWord.php
http://localhost/xammp/HelloWord.php
amongst others and I cannot find the right url.
I am using XAMPP on a Mac Majove.
If you installed the XAMPP VM version, then you can probably access it via http://192.168.64.2/HelloWord.php (check the General tab in the XAMPP app for the IP address)
If you installed the native version, then I guess it is
http://localhost/HelloWord.php
The htdocs/ folder is the document root. Its content is served under the server address. Neither the xampp nor the htdocs folder will be part of the URL. The paths are relative to the document root, and you shouldn't be able to access parent directories above htdocs/ (although server-side code such as PHP has access to the file system and may work with files outside of the document root).
First of all, expecting the php file to have information that can be visualized in a web browser, inside xampp if you have the .php file in the htdocs folder you should be able to visualize it like this:
http://localhost/HelloWord.php
Found it by trial and error, quite different from what I took from various instructions on line:
http://localhost/HelloWord.php
XAMPP's default root should be "htdocs" or "www". Put your PHP files into those folder and try again.
if it is not work, find the configuration of Apache and PHP in XAMPP folder.

Access remote Windows server FILES from Linux Apache Webserver via Browser Hyperlink

I have installed an apache webserver on Linux Debian and created an intranet on it. The intranet basically shows tables with entries from sql queries via php and mysql.
In one of these tables I would like to add a hyperlink that leads to/opens files and folders on a remote windows server.
I can access these files on the windows server from my linux webserver via cifs protocol.
How do I tell apache and/or linux where they need to go when a user clicks on a hyperlink in my intranet?
The path for the windows server is: \10.0.10.100\data\moredata\file.xls
I can access the windows server folders on my linux webserver via the following path: /media/data/moredata/file.xls
However, if I place this path inside html tag like this:
open my file please , it won't work.
If I try it like this: open my file please , it also won't work.
I believe that I need to insert the path inside apache.conf ? Is this correct? And if so, how is it done exactly?
You have to create Alias for that. Like 10.0.10.100/media can be pointing to your root /media folder. You can do it in your config file. Hope this link can help.

XAMPP won't open PHP files in directory (Mac)

All the servers are running correctly in XAMPP, and I when I run http://localhost the XAMPP page comes up. However when I try to run a php through xampp by accessing the directory where the file is stored, i.e.,
http://localhost/Applications/XAMPP/xamppfiles/htdocs/gallery.php
I get error 404. I've tried loads of different paths, but here is the path to the file in finder path image
Any ideas?
Thanks!
your webserver is resolving the domain localhost to a specific directory, the so called document root. (this can be adjusted in your server config). I would assume that it points to /Applications/XAMPP/xamppfiles/htdocs. so your file should be accessible via
http://localhost/gallery.php

Open file using modify address instead of default address

When XAMPP is installed, we can open file using URL like localhost/home.php. Can we open the very same file like (for example) using an URL like hamzazafeer.com/home.php or www.hamzazafeer.com/home.php? Is there any way or we can't change this address?
You can override the domain target to localhost. That means that your browser "thinks" that the domain is on localhost. The browser will fetch then the local files instead of calling a remote server. To do that you have to edit in C:\Windows\System32\drivers\etc a file named hosts. Depending on your operating system and settings it could be a little hard to edit the file. But you will find further specific information with the help google.
The row you have to add into this file will look like:
127.0.0.1 hamzazafeer.com
Yes and no.
Yes, you can. In default XAMPP installation, it always points to some default folder (htdocs folder in its root folder under Windows, /var/www under Linux etc.) This answer may help you locating this folder in your installation of XAMPP).
You can install (FTP copy) XAMPP on any hosting, where your domain hamzazafeer.com currently points to, and properly configure it (both hosting and domain) to point to your XAMPP's default websites folder and you're ready to go.
(BTW: You're mixing certain things. XAMPP nothing to do with this, it is Apache's configuration variable plus XAMPP / Apache has nothing to do with this in general -- you can point your domain to any folder on any hosting, no matter, what server software is used to serve your website)
No, you shouldn't. XAMPP is from the begining to the very end designed as localhost, test-purpose-only, developer-only solution. You should ever, never use it for serving production version your websites or anywhere on any publicly-accessible hosting. Limit it only to your localhost, as it was meant by XAMPP's creators.

PHP sample project with wamp

I installed wamp stack and then installed netbeans ide. The port number for apache is 100.
Created one PHP project at
C:\Users\aaa\Documents\NetBeansProjects\PhpProject2
and project URL http://localhost:100/PhpProject2/
When I click on run, I see the message "http://localhost:100/PhpProject2/index.php URL not found on the server".
What else I need to do to connect http://localhost:100/PhpProject2/index.php to C:\Users\aaa\Documents\NetBeansProjects\PhpProject2?
Please help.
You need to configure Apache's webroot to be C:\Users\aaa\Documents\NetBeansProjects (search for DocumentRoot in the file httpd.conf).
Or you can move/copy your files to the existing webroot, which may be something like c:\wwwroot.
Apache doesn't just magically know where you put your website files, and setting the URL inside NetBeans doesn't actually configure the webserver (I think it's just so that auto-generated links are right).
If you go to http://localhost:100/, what do you see? What is your web root? The folder needs to be in your web root, and I would be surprised if it is C:\Users\aaa\Documents\
I did a Google search for "wamp stack" and found a product by Bitnami... if this is the one you are using, the default web root is C:\Program Files\BitNami WAMP Stack\apache2\htdocs\. If that is indeed the case, then you'd need to move the NetBeansProjects folder to there. (source: http://bitnami.org/files/stacks/wampstack/5.3.6-0/wampstack.pdf page 7)
You need to look into aliasing. That will let you more or less assign directories in the url path to arbitrary directories on your file system.
You have to move your files to your root folder of the Apache installation (htdocs). You should refer to your WAMP installation for where that is located. Personally, I like to use XXAMP for installation.
Netbeans is just an IDE, it doesn't serve the files.

Categories