I am a little bit confused about the fact that PHP can only use DLL files for a DOTNET object from the Global Assembly Cache and not from a local folder (from what I know). How is your site, that's using a DLL, going to work, when your web server doesn't have such a GAC? Right now I am developing on my local machine; No problem, but I am worried if I will be able to run my site elsewhere.
So my question is: Is it possible to access a DLL from another location than the GAC?
I have seen quite a lot questions/answers already, but all of them were relating to ASP.NET and how to use DLLs in Visual Studio.
Thanks in advance
-Snrk
EDIT: I could describe what I want as a "LAC" (Local Assembly Cache).
Related
Previously I used shared hosting, and the hosting company provided Apache Tomcat with PHP and MySQL. I have since switched to virtual private server hosting with Linux, so I can use a server of my choice, in particular Glassfish 4.1.1 for Java ServerFaces 2.2 applications, and have already deployed a war file for a particular application.
However, I have quite a lot of old code, including some PHP. I have put my old code in Glassfish's docroot folder and all the straight HTML5, JavaScript etc. work without any problems. How do I get the PHP code to work as before? In doing a Google search, it appears possible to deploy a war file from Quercus, but if this is done, how do I get PHP to work in the docroot folder?
I'm not aware of anybody who has done this before, so any advice would be most appreciated - thanks in advance.
I used GlassFish before with JSP. Now PHP has become the language of my choice. I feel like it's much more maintainable.
But to answer your question, in order to get PHP to work in the docroot server, you have to enable PHP on OracleGlassFish Server. From Oracle documentation :
1. Download the Quercus PHP interpreter from http://quercus.caucho.com/.
2. Deploy the downloaded WAR file to the GlassFish Server.
3. To verify that your PHP engine is working, enter the following URL in your browser:
http://localhost:8080/quercus-4.0.1/
4. Move your PHP application to a subdirectory of the Quercus directory.
5. To verify your PHP application is working, access your application from a browser.
For example, enter the following URL in your browser:
http://localhost:8080/quercus-4.0.1/myapp/
Also, this previous answer from SO may also help :
Allow Glassfish and PHP to work together in the same server using Apache
I am currently working alongside a project team for the development of a website and we are using SmartFtp for file sharing.
Does anyone know how to compile/edit php files through SmartFtp? I.e. using apache for compiling and atom for editing.
Please note: I have already tried copying the files into the htdocs folder within xampp but had no luck. The php files did not successfully copy into the htdocs folder.
Thanks again
Fair warning...
This is a terrible way to host a project. Each developer should have their own isolated project installation. Even though you only have a few developers, it's only a matter of time before you get a collision and somebody loses work.
Using FTP is also a terrible idea. It is completely insecure.
That said, you've got a couple options:
If your dev server is a *nix flavor, you can probably use SSHFS to mount the remote directory on your local machine. This will allow you to edit the remote files live, as if they were any other regular local file. This is secure and relatively easy to set up, but you may find it a bit too slow for anything but small projects.
Use FTPS/SFTP/SCP to push files to the remote server when you save them locally. I'm not terribly familiar with Atom, but many IDEs (like NetBeans and PHPStorm) can be configured to automatically FTPS/SFTP/SCP push changed files to remote servers. Just save locally as you normally would, and in the background, the IDE will perform an FTPS/SFTP/SCP push. Do not use FTP. If your server has FTP configured, it probably also has SFTP and/or FTPS configured.
Create your own development environment. Host your own site on your own machine so that you don't collide. You can run Apache/Nginx/PHP/MySQL directly on your machine, in a virtual box, or even a docker container. This is the best and most flexible option, but also requires the most effort to get running.
This should be a comment, but its a bit long.
I am really confused by your question.
how to compile/edit php files
PHP uses a run-time compiler. Are you talking about Roadsend or HipHop or something else?
development of a website and we are using SmartFtp for file sharing
Presumably you don't give a damn about your code integrity, managing conflicting code changes, version control or the security of your development environment. It's 2017. FTP was way past its sell-by date before the turn of the millenium.
compile/edit php files through SmartFtp
It's an FTP client. Just one of many things you don't use to compile or edit files (others include an avacado, a tennis shoe, scissors, a sunset...).
Presumably you are using this client to connect to a server - which you've told us nothing about. You probably want to do the collaborative bit of your code management (if that is what you are asking) on the server.
(from comments)
Development sever with multiple people pushing edits ad hoc while they code through an Ftp server.
That's not a "development server" that's a recipe for code armageddon.
I'm a real klutz when it comes to Eclipse, but I'm also poor, which is why it is the option I've chosen.
I've installed Eclipse 3.5, Eclipse for PHP, and RSE. I've actually gotten to a point where I can create a new (local) project and download all files to my local (Windows) computer. I'm not running any kind of web server on my local box, and am hoping to keep it that way for now.
I've imported my remote folder into my local project, where I can see all my PHP files and edit them. But of course, when I save, it just saves the local copy. Is there no "put" command? Can I not save straight to the server? Or perform an immediate sync of that one file? I certainly wouldn't want to have to perform a complex sync operation after every little incremental change.
I have no idea what RSE really is, nor how it works, and the documentation is, well, cloaked at best, non-existent at worst. Does anyone have some tips for me? What should my workflow be (barring any local server to test)?
Ideally, I would love to be able to open up the entire "project" directly from its location on the remote server and avoid dealing with a "local" copy altogether. Failing that, I would be willing to "get" the entire remote site once, and then manually "put" individual files that I change locally back, provided it's not a cumbersome process. Am I asking too much? Dreamweaver operates this way, but it's support for PHP is limited at best and can't be considered a full-fledged IDE...
I use WinSCP and enable remote synchronization.
Everything that changes on the local system is automatically synchronized trough SCP/FTP onto the server.
Looks like RSE might be overkill for your needs. Here's a similar question and popular answer to your problem of uploading from Eclipse:
How do I add FTP support to Eclipse?
Secondly, you could try out a version control system like SVN - it would take a little bit of time and work to set it up but probably be far more useful than getting RSE going and then you could develop locally, commit your changes to the server and then update the workspace on the server.
Thirdly, there are other IDEs out there, like Netbeans, with built in support for working on remote files.
Sorry to drag up an old topic but Remote System Explorer is exactly what you need. No need for sFTP or a Shell. Setup the connection in the RSE perspective just like you normally would using your sFTP/SSH client.
Open the folder for the first time and you get the login dialog. Enter your credentials. Store them as needed.
Now navigate to your development files and double click or right click to open the file. Eclipse caches a local copy till you save, Ctrl-S.
Need to do some shell work. Right click on a folder and Launch a Terminal. If your files are source controlled, such as svn, you can checkout or update from the terminal.
I use to have Putty, FileZilla and a host of other editors and utilities. Now I never leave Eclipse. SQL, Shell, sFTP, PHP, CSS/HTML, C/C++, Droid, all within Eclipse.
I tackled the same problem recently. I got a web site hosting company and was using SeaMonkey and developing the code on the 'production server' and learned to do development on a 'development server' and then upload the debugged, working stuff to the production server.
So I use Xampp (it's a good, and FREE, local web server you can easily install on your laptop) and I use NetBeans to develop. Netbeans is better than Microsoft tools -- no ballmer involved in the deal.
xampp uses Apache as the (local) web server and provides Mysql and PHP server-side-scripting support.
The quality of these two is HIGH. Just excellent stuff. You will want to get a local web server running on your laptop, do your development locally, then upload using ftp or the Netbeans environment, the files to your 'production web server.'
I messed around with a lot of different unrelated pieces trying to put a local web server, debugger, mysql database together and then got really lucky and found xampp and then NetBeans.
I think #Ćukasz's note deserves to be an answer on this page - it would have saved me a great deal of time, so hopefully it will do the same for others:
Here is great tutorial for Eclipse: How to setup Eclipse with PHP PDT, Remote System Explorer, Theme Manager, and Drupal Plugins Eclipse + PDT + Remote System Explorer allows you to develop PHP applications remotely.
I will add that downloading and using the smaller Eclipse for PHP Developers and thus skipping step 2 on the blog works just fine.
I am asp.net developer , i want to learn php
what are the software need to run compile php file ?
how to install this software any path that should be set ?
what kind of database it needs to store data and retrieve date ?
see me as beginner and then give the idea / information ..........
thanxx
You just need the PHP interpreter and if you want to do web stuff a webserver.
You can get the interpreter from http://www.php.net - if you are using windows you really want to get a binary version and not compile it on your own - and the Apache webserver.
As a database PHP developers usually use MySQL (but it can also connect to most other databases).
The easiest way for your to get started is getting a package like XAMPP which will contain all you need without requiring you to configure everything manually.
For actually learning PHP, please get a recent book/tutorial. Old stuff is usually telling people to do horribly things every sane developer will hate you for (cluttering your global namespace with variables settable by the user for example).
You could have a look at the official PHP docs which also contains a "getting started" guide.
Since you are an ASP.NET developer I assume that you are familiar with IIS and that you're probably using IIS 7.5. If so then the easiest way to familiarize yourself with PHP is to use Microsoft Web Platform Installer and install PHP directly to IIS. You don't have to set any paths after that, just create a site on IIS and start putting PHP files there. Keep in mind that Web Platform Installer automatically enables WinCache extension and your changes might not be there when you hit the refresh button. Just locate the php.ini and comment out the relevant line.
Straight from the horses mouth. Getting Started. You will need a php interpreter, if you have access to a webhost that has php installed you're half way there, if you have a linux partition you're half way there, otherwise check out XAMPP.
Software: XAMPP will get you up and running
Tutorial: w3schools
If you are familiar with IIS and want to use it as your web server you can download PHP for IIS here and use some of the learning material there to get started.
If you did not want to use IIS and wanted to use Apache instead then I agree with the others XAMPP will get you a dev environment up and running quickly.
I have written web apps with JSP in the past. Now, I'm getting started with PHP. I have a question and a friend of mine who is a .NET developer pointed me to this site.
I downloaded and installed PHP from here. Now, I'm trying to get the Windows Azure for PHP SDKs setup. The reason for this is that my app needs to be hosted in Azure. After I downloaded the SDK, I looked in the install.txt file. The file states that I need to add the library directory to my PHP include_path. My problem is, I do not see an environment variable named "include_path" in my settings. Should one have been created? Is the PHP include_path even an environment variable? Can someone help me out please?
Thank you!
include_path is a configuration setting usually set in the php.ini file.
Run a PHP script containing
<?php phpinfo(); ?>
to find out which php.ini is actually being used - it can be confusing sometimes.
The INI file will contain the setting, which you can then change.
You will probably need to restart the web server after changes.
I don't know how PHP and Azure work together. If the INI method doesn't apply here, here is the PHP manual section on ways to change PHP config settings other than php.ini.
I would go with a dedicated development system like XAMPP. Although it should be noted that XAMPP should NEVER be used on a production system. It is very insecure and they are very very very slow at patching known vulnerabilities in their stack.
Question: If you're planning on building an Azure based system, why are you choosing to build it in PHP rather than C# on ASP.NET?
.NET is Microsoft's primary platform for web infrastructure development: Azure support will come quicker and will be FAR more thorough for .NET vs. any other platform.
Remember: "Just because you can doesn't mean you should" ;)
I strongly encourage you to build your Azure site in .NET, not PHP.