How run Symfony project without virtual host? - php

I have my own server how can I run symfony project without creating virtual host.

Do I really need VirtualHost for symfony development?
It all depends on personal preference, if you want to open project with virtual host you can configure it, if not keep like this
localhost/project_folder/web/app_dev.php.
Your symfony app will run with the above URL. I have hosted so many apps on Cloudways and I ran my apps with the URL like this
phpstack-21306-71265-234521.cloudwaysapps.com/fos/web/admin
so I don't need to setup a virtual host either on live server.

Related

SOS! How do I deploy multiple Laravel apps on a windows IIS server in a LAN

I am setting up an IIS server in readiness to host multiple PHP web apps. These will be used within our local network so no need internet access. I have read a lot of stuff on how to go about it but am getting lost even more. someone please help.
You can refer to this document for detailed steps about deploy php application on IIS.
Here are some main important points:
Install IIS in control pannel(windows) or server manager(windows server).
Configure php. Youcan download it from php official website or Web PI(more recommand). The version over php8 may not work on IIS.
Make the physical path of site points to root folder of application. It will auto generate web.config. Set the permission of root folder to avoid 500 error.
If you have multiples version of php, you can isntall php manager to configure them.

How to give on local to other pc access to your project in valet?

When I make a project in laravel I can give access with php artisan serve but if a make a normal project and make host with valet link the PHP artisan don't work because it's not a laravel project. How can i give access to local with valet ? For example i have project.dev and make 192.168.1.5:80 like in laravel.
You can use the valet park or valet link commands to be able to access your application locally.
For a local network, you will need to make sure your port is accessible if your're behind a firewall. You may need to setup port forwarding, as well, if NAT is involved.
Are you trying to make the project accessible to others on the internet? For this, you can use ngrok.
https://ngrok.com/
”I want to expose a local server behind a NAT or firewall to the internet.”

How to deploy symfony 2 app

I am new to symphony2 and I need to know how can I make my application run without the server:run commmand. What do I need to do to be able to make it run inside the root folder of my nginx server on port 80?
There are several steps you need to do.
1. Install Apache or similar web server on your hosting server.
2. Create a virtual host which points to the directory where your Symfony app is.
3. Allow proper permissions to folders.
4. Run your web server from specific console command.
Refer following two URLs for more details:
http://symfony.com/doc/current/cookbook/deployment/tools.html
https://www.digitalocean.com/community/tutorials/how-to-deploy-a-symfony-application-to-production-on-ubuntu-14-04

Create and consume web service on local machine by using WAMP

Is it possible to create an environment on local machine( i.e. localhost) where we can create and consume web service using PHP?
Is there any flow to create a web service like environment on localhost?
I would like to create an environment on localhost for web services where local machines, on intranet, get connected to main server (here again it's local machine) and can consume web services.
Like on internet we have Web Servers from where we can create and consume web services, Can we do the same on localhost?
Edit:
I am using WAMP with
PHP 5.3 Apache 2.* MySQL 5Windows 8
It is easy to create a local web service. You will need a local web server (like IIS or xampp) to execute PHP locally.
Access you PHP application in your browser using http://localhost/<yourApp>.php and provide any webservice at a local URL as well, e.g. http://localhost/<yourService>.php. Your application can then access the webservice using the local URL.
This works both for REST or SOAP-style services.
EDIT: Your edit shows that you already set up a local environment to develop and test webservices. You should really be more specific in your question, maybe you are looking for a tutorial to create web services with PHP in genereal. If so, Google will be your best friend: https://www.google.de/#q=create+web+service+using+php+tutorial

unable to deploy symfony project to a shared hosting web server

i am using Symfony 1.4, to create my project. i have tried to deploy project using the command and methods given in chapter-16 in symfony book. but i am not able to deploy my symfony project from my local computer to web server. Can i directly copy paste my symfony project to my web server?? will that work?? or is there any other method??
NOTE: i am using Propel as ORM.
Your best option is:
1. gzip up the entire project
2. export all the data from the database using something like mysqldump
3. upload the files to the server
4. import the database dump into your server database
5. unzip your project
A couple notes:
1. Due to the shared hosting environment, you may have security issues due to other hosts on the server gaining access to your php files See here.
2. Hopefully your host allows SSH access to your server account, administering a symfony project is MUCH easier when this is the case.
3. If you don't have SSH access to your account you will have to upload the files to the server without gzipping them and this takes a LONG time due to the number of files symfony creates.
4. If possible place all your symfony files except for the web folder outside the public_html folder.
When I have to deploy something I do this:
Check if the requirement (php5, mysql4 etc) on the production server matches my application.
Change the configuration files to reflect the production server.
Upload everything to the server using ftp.
Your question is cryptic, you should really specify what kind of error you are getting.

Categories