Symfony Missing sf folder - symfony

This question is not really related to programming, but I dont know where else I should ask it.
I just installed Symfony on Xampp for windows, now I struggle getting it to work because it is missing the project/web/sf folder and I can't find anything about it on the internet.
The missing of this folder causes me to lose the css files and images ect.
I installed Symfony via Pear and then just got a clean project using symfony generate:project projectname
[edit]: this is how my homepage looks after loading;
[edit 2]: Printscreen of version number seen on web/app_dev.php (which is one of the few pages working correctly)

It looks like from your "3 methods of installing" you have mixed multiple versions of Symfony into one installation. The symfony_data/web/sf problem is unique to Symfony 1.x only. Symfony2 does not use the web/sf structure, and instead utilizes web/bundles/framework for framework assets.
This makes sense since the PEAR channel isn't supported for Symfony anymore (see the big red header?) Plus, you can only get Symfony 2.x by explicitly using pear install symfony2 (not pear install symfony). You may be using the old PEAR channel located here (see how they're all 1.x versions?) and symfony-project.com redirects to symfony.com/legacy
So now when you access app.php you get Symfony 1.x, and when you access app_dev.php you get the newest version of Symfony ~2.5. This makes things very confusing for both you and us.
What's the fix?
Start over. Remove the project folder and its contents entirely. Then follow these installation instructions (I've condensed them for you):
Start in your desired project folder.
curl -s https://getcomposer.org/installer | php
php composer.phar create-project symfony/framework-standard-edition ./ '2.5.*'
php composer.phar install

You must make an alias on your web server apache, like this example:
# Be sure to only have this line once in your configuration
NameVirtualHost 127.0.0.1:8080
# This is the configuration for your project
Listen 127.0.0.1:8080
<VirtualHost 127.0.0.1:8080>
DocumentRoot "/home/sfprojects/jobeet/web"
DirectoryIndex index.php
<Directory "/home/sfprojects/jobeet/web">
AllowOverride All
Allow from All
</Directory>
Alias /sf /home/sfprojects/jobeet/lib/vendor/symfony/data/web/sf
<Directory "/home/sfprojects/jobeet/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>

Related

Migrating Drupal

Currently I have a single drupal site installed on apache 2.2 with php 5.3 on RHEL 6. I am moving servers and am trying to migrate the site. I have imported the database and htaccess, but I cannot access any of the pages other than the root of the site.
You may need to disable clean URLs before exporting the database, try to add ?q= before each path.
That happens when:
a) Apache mod_rewrite is not enabled. If you have root access then do sudo a2enmod rewrite
or
b) .htaccess file at the root folder isn't there, so you need to copy it again.
Here's a troubleshoot check list for mod_rewrite issues:
Make sure Apache's rewrite module is enabled: sudo a2enmod rewrite.
Make sure original .htaccess file is there in the root of your Drupal installation.
Make sure that the existing .htaccess file is getting read by Apache. To test it, add a this line in the beginning of the file and you should get a 500 Internal Server Error: ThisIsReallyABadSyntax.
If the .htaccess file is not in effect, make sure that the AllowOverride directive in the main Apache config file (usually /etc/apache2/httpd.conf on debian-based distros) is set to All. It might be set to None by default.
Finally, make sure that the clean URLs feature is enabled in Drupal settings.
With the phpinfo(); compare all the server specs, just to be sure both server are quite the same or similar.
Steps to migrate Drupal correctly:
Go to Configuration
find Clean URLs
Disable tick inside!
Clean cache!
Download your site file
Download your database
Create new database in your new site
Transfer file and database
Log in
10.Do this step to enable Clean URLs:
It's work 100% guaranteed !
Steps:
1. Download - Dev version (7.x-dev)
2. Find file .htaccess
3. just copy it to your server
4. That's it !

Symfony2 what to do when deploying manually?

Since i can't find any useful information on Symfony2 website i'm asking here. What should be done when manually deploying a Symfony2 project? As far i understand:
Edit app/config/paramenters.ini to meet server paramenters
Update vendors to the latest version: php bin/vendors update
Install database with php app/console doctrine:database:create then tables with php app/console doctrine:schema:update --force and eventually load fixtures: php app/console doctrine:fixtures:load
Dump and install assets/assetics: php app/console assets:install --symlink web as long as php app/console assetic:dump --env=prod --no-debug
Symlink index.php to web/app.php, assuming that all files from Symfony2 distribution are in the root of the web server
Remove web/app_dev.php (is this really necessary?)
should app/config/paramenters.ini left untouched? What about security concerns?
Am i right? Thanks for helping. I think that Symfony2 documentation should cover this too.
EDIT: virtual host example:
<VirtualHost *:80>
ServerName symfony.local
DocumentRoot "C:/www/Symfony2/web"
DirectoryIndex app.php
<Directory "C:/www/Symfony2/web">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
Only two things I wouldn't do is:
Symlink index.php to web/app.php, assuming that all files from
Symfony2 distribution are in the root of the web server
Remove web/app_dev.php (is this really necessary?)
The thing with the symlink might be ok, but I prefer to link the webroot directory with the web directory of symfony2.
Second thing is, you don't have to remove app_dev.php, because it can only be run from localhost (it checks the IP). So no need to remove it, and I personally sometimes want to see debug info on the webpage (maybe not best way), and than I just add my own IP to app_dev (and remove it afterwards).
Yes. That is all. And also you don't need web/app_dev.php in prod environment.
Moreover, web folder should be document root and run app.php
I think you should put DirectoryIndex app.php inside <Directory></Directory>

WAMP + directory alias + Drupal clean URLs

I have WAMP installed on my pc where I would like to run Drupal 6.
When I'm installing Drupal, I get the option to activate Clean URLs.
First I put my Drupal install in the www folder and I could choose to enable the clean URLs, but for backup reasons I moved it outside the www folder and created an alias the would point to the folder.
When I installed Drupal again, I couldn't choose to enable clean URLs anymore; the option was grayed out.
I would like to know why this happens; it seems some Apache module or PHP extension isn't available outside the www folder.
Just to be sure, I also tried an XAMPP install and created an alias with the some code lines as in the WAMP server but that worked, for some reason. The Apache version in WAMP isn't the same as the XAMPP install but I don't really think that is relevant.
I believe it's an config error in WAMP but I can't find out what.
Clean URLs doesn't work in the directory you copied Drupal because for that directory the directive AllowOverride is not set to All.
Drupal requires that every directives found in .htaccess files are enabled, in order to enable clean URLs; the directive AllowOverride, when set to All, allows to use all the directives that a .htaccess can contain.
The reason that in one case you can select the the option to enable the clean URLs, and in the other case is not selectable, is that Drupal, during its installation verifies the server is set to work with clean URLs, and change the form field to read-only if the server cannot support such feature.
To notice that the .htaccess file provided from Drupal can possibly need to be edited, in order to enable the clean URLs, as reported in the following comments, found inside the .htaccess file.
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /

Drupal Acquia Stack - Have moved files to different folder, how to update site?

Im using the Acquia stack instead of MAMP or WAMP but im using it to run a normal Drupal installation.
I imported a site fine. Ive then moved the sites's files to a different folder, and now I cant figure out how to change the site's settings.
In the stack interface, if I go to my site and click settings > Sites > Edit
Then I can see the Site Path that it points to the old folder, but I cant change these settings.
Do I need to create a new site and import it again?
Thanks
I was looking for this answer, and digged out into acquia install folder. Here is what I did to change Site Path at acquia desktop interface.
Don't forget to make a backup just in case.
There are 4 files to attend to:
Open and edit static.ini and dynamic.ini under your AcquiaDevDesktopControlPanel at Program Files/acquia-drupal install folder. Maybe different on Mac.
Edit siteDir at static.ini
Edit selImportedSiteCodebase and codebaseDir at dynamic.ini
Edit httpd.conf at apache folder to use your new document root. There are 3 or 4 locations to change there
Edit vhosts.conf to reflect your new locations
You have to run the notepad as administrator.
Its seems that changing only #4 + #5 don't hurt my sites, these can be done via acquia interface. But changing #2 + #3 makes you feel comfortable :)
Hope that helps
I had the same question. I'm running Acquia Dev Desktop and wanted to change the default folder of the installation from /drupal-7.10 to /docroot.
I'm running this on a Mac and after reading the posts above, I searched for the dynamic.ini and static.ini files which were not to be found on my harddrive. Checked the httpd.conf file and didn't see anything mentioned.
I ended up making a backup copy of vhosts.conf and changed vhosts.conf to:
<VirtualHost *>
ServerName loc.MYWEBSITE.com
DocumentRoot "/Users/dv/Sites/MYWEBSITE/**new_dir_name**
<Directory "/Users/dv/Sites/MYWEBSITE/**new_dir_name**">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory<
<VirtualHost>
Refreshed the browser and I was good to go.
I ran into this problem as well, the only way I was able to remedy was to dump the database delete the project, then re-import. Just an FYI, make sure that the settings.php in Drupal are set up correctly for the localhost setup, this was another snafoo for me.
.. I looked all around the Acquia files to try to find a place where it was storing this information first but could not find it
In .htaccess, is the RewriteBase line pointing to the right directory? Ex:
RewriteBase /new/directory/
You'll also need to edit the - C:\Windows\System32\drivers\etc\hosts - file to update any entries
On Mac OS X you will need to find and edit paths in the following files:
~/.acquia/DevDesktop/locations.ini
~/.acquia/DevDesktop/Drush/Aliases/aliases.drushrc.php
/Applications/DevDesktop/apache/conf/vhosts.conf
/Applications/DevDesktop/apache/conf/httpd.conf
and, most importantly, in the DevDesktop package itself:
In /Applications/DevDesktop - right-click Acquia Dev Desktop
Select "Show Package Contents"
Edit datamodel.xml and static.ini

How to place certain files in the root directory of the Grails server?

I am using a grails application as backend for a Flex frontend. To be able to easily develop and debug my applications I would need to place a crossdomain.xml file into the root of the server, i.e. it must be accessible via http://localhost:8080/crossdomain.xml. Similar use cases might be the deployment of a favicon.ico or a robots.txt, however this can be done in the production environment through a tomcat server with a default root web application.
In my case however I need to have the crossdomain.xml available after running grails run-app. I know that I can move the entire application to the root (http://ca.rroll.net/2009/03/27/configuring-the-grails-root-application-context/) however this is also not what I want, since the grails application should still reside below its default application context.
Does somebody know, how I can do this? Will I have to reconfigure the jetty servlet container of my grails installation somehow?
I think I found the answer. I haven't tried this yet, so YMMV.
In this article, Colin Harrington discusses making a crossdomain.xml file available at the root of the server by deploying an additional Jetty context.
His technique was first proposed in this blog entry, where the author also discusses using the Static Resources Plugin as another alternative
I figured out a way to solve this with Apache and mod_proxy. This allows both your Grails install and Grails project to remain pristine. No hacking at the Grails internals, no adding plug-ins you may not need in production.
1. Install Apache httpd 2.2
Do this however makes the most sense for your operating system. It is important that you install Apache 2.2. I did this on an Ubuntu system, so any specific commands and file locations will be for Ubuntu. Modify as necessary for your system.
After you've installed Apache, start httpd.
sudo /sbin/service httpd start
Test that it is installed correctly using a web browser.
2. Create a root directory
Pick a location on your disk where you will keep your static files. This will be the document root for httpd. I will be using /var/grails_root.
mkdir /var/grails_root
touch /var/grails_root/crossdomain.xml
3. Create a VirtualHost in httpd.conf
Open httpd.conf in your favorite text editor.
vim /etc/httpd/conf/httpd.conf
Pick your favorite port, and create a virtual host on that port. I will be using 9090, but any port will do.
Add these lines to httpd.conf
Listen 9090
<VirtualHost *:9090>
DocumentRoot "/var/grails_root"
<Directory "/var/grails_root">
Allow from all
</Directory>
</VirtualHost>
Restart httpd
sudo /sbin/service httpd restart
Test that you are now able to access the static files in your document root directory. If not, you will need to fix this before moving on to the next step.
4. Enable mod_proxy and mod_proxy_http
You need to load both of these modules. mod_proxy has the base functionality for proxying, and the mod_proxy_xxx modules have information specific to a protocol. They ship standard with httpd 2.2, so you shouldn't need to install anything extra.
Add these lines to httpd.conf
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
Now modify the virtual host you set up in the previous step. (You can omit the comments)
<VirtualHost *:9090>
DocumentRoot "/var/grails_root"
<Directory "/var/grails_root">
Allow from all
</Directory>
# New lines start here
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /grailsApp http://your.grails.server:8080/grailsApp
# New lines end here
</VirtualHost>
Restart httpd
sudo /sbin/service httpd restart
Now, you should be able to access both your static files and your Grails app via port 9090.
This is all based on information found here: http://docs.codehaus.org/display/JETTY/Configuring+mod_proxy
Information for doing this with other versions of Apache is available on the same site.

Resources