How to upload my Symfony project to shared hosting? - symfony

I have a Symfony 3 app that I need to deploy to a shared hosting server - hostgator. I have copied all of the contents from the web folder into the public_html folder. I also copied all the other folders on the root of my directory. However, I does not run.

Did you check the proper permissions in particular the var/ folder, this is described on this page.
Also, if they use apache, you will have to set the owner:group of the web folder properly.
In Linux that is done easily by this command (from the root folder):
$ chown -R apache:apache web/
Try that out (you might need sudo access to run chown).

Related

Openshift JBoss Logging

Hi I am deploying my spring application to Openshift Jboss AS. The problem is whereever i placed the log4j.properties it is not read by the application. I've tried the following ways to achieve this but can't.
Placed my log4j.properties in WEB-INF/classes.
Placed my log4j.properties in WEB-ING/resources and in web.xml loaded the
context-param for log4jConfigLocation.
Created a
jboss-deployment-structure.xml in META-INF which excludes log4j
logging.
Nothing seems to work . Can some one please help me.
In Jboss there is a default logging available, which can be implemented by modifying standaole.xml.
In Openshift when you ssh into your app using the below command
rhc ssh <app-name>
You will taken into your application where when you give ls command you will see the list of files and folders, you can find jbossas folder change your working directory to that folder
cd jbossas
execute ls command you will see list of folders where you will find standalone folder, change your working directory to this folder
cd standalone
again execute ls command you can see configuration folder, change your working directory to this
cd configuration
now if you execute ls command you can see standalone.xml, we need to edit this file, but editing here may not work because this standalone.xml is a copy of the another file which is in the following folder .openshift/config/standalone.xml . You can find this folder where you clone your git copy, Not in eclipse go to your working directory in window.
We need to edit this file and add our logging properties here. thats how it works

where to put wordpress htaccess on openshift

I have cloned my wordpress application from openshift with git, in my cloned application there is php folder, when i put my htaccess file in it then i commit my changes like this :
git add -A
git commit -m 'ok'
git push
My htaccess file is not pushed in the application repository folder on openshift, but when i put it via ftp with filezilla it works, not with git.
I don't know where i have to put .htaccess file ? if it is in php folder, why it's not uploaded ?
If you used our official quickstart, you would need to use an action_hook (probably deploy) to copy a .htaccess file into place, otherwise the files are actually not stored in a place that is affected by git. You could also try using this quickstart( https://github.com/openshift-quickstart/openshift-wordpress-developer-quickstart) where EVERYTHING except for uploads, is stored in git (plugins, themes, etc)

Unable to create directory wp-content/uploads in Wordpress

I created php files for my plugin and added them to myplugin folder. Then I zipped myplugin folder as myplugin.zip. In Admin Panel of Wordpress I wanted to install my plugin to wordpress. I choosed this zip file and clicked to Install "Now button". Then Wordpress gave an error:
Unable to create directory wp-content/uploads/2013/05. Is its parent directory writable by the server?
What is the problem and how can I solve it? My OS is Linux and I use XAMPP server in my machine.
In your terminal, navigate to the wp-content folder and then run:
chmod -R 0744 plugins
That will set the folder and its subfolders to read/write/execute for you and read for everyone else.
Edit As suggested in the comments, check this out: codex.wordpress.org/Changing_File_Permissions
Alternatively you can just unzip them yourself and save them into this folder:
/wp-content/plugins/name-of-theplugin
Then you can just activate the plugin from the admin page.
I am not entirely familiar with XAMPP but it should be run as a user. Most likely your own windows account. You may try this:
Select the folder wp-content and right click -> properties. then go to Security Tab. There check to see if the User (i.e. you) has write+ modify permission.
Check what is XAMPP server running as, the folder above must have the permissions for the same user.
Double check the "general" tab on the wp-content folder and check the "Attributes" section. Make sure "Read Only is unchecked. If you are changing it, windows will prompt for whether to apply to subfolder. Say "yes".
. Or run XAMPP at Administrator and skip the above step .(assuming it is not production / public internet facing server).
I had this problem yesterday, I solved it by uninstalling the Wordpress module and installing it again as root from the terminal.
I thought if I run the installation wizard as I was logged as root was enough, but it wasn't.
These are the steps for MacOS:
Uninstall wordpress module. Be sure the folder is empty.
Mount the wordpress disk image
cd /volumes/nameOfWordpressModule image
sudo bitnami wordpress module.app/Contents/MacOS/installerbuilder.sh
I recommend you to list the items so you can write exactly the name of the image and app.
Hope it helps!
navigate to your main project folder and run the following:
chmod -R 0777 wp-content
in case of MAC run
sudo chmod -R 777 /Applications/XAMPP/htdocs/

Will Symlink do as im hoping - treat one folder same as another

I want to symlink:
/var/www/ThisFolder
to this folder
/var/www/htdocs/Thisfolder
I.e Symlink the folder that is in a non web accessible directory to link to one that is.
I plan to do this via:
ln -s /var/www/ThisFolder /var/www/htdocs/Thisfolder
Will my server then treat the folder outside the root as if it were inside the root?
Permissions on symbolic links are kind of funny. If you don't have permissions to view your target folder (/var/www/htdocs/Thisfolder) you wont be able to access it through the symlink. The permissions you will see by doing an ls -l on your symlink will show its permissions for renaming/unlinking the symlink, not for the target.

Problem with file permissions in Drupal 7

So, I've copied the install tree of a site I'm developing to another machine. After updating settings.php to the proper db and base_path, and making sure that the file permissions for /sites/default/files/ are set to 755 (chmod -R 755 files), the file settings page (Configuration -> Media -> File System) insist that "The directory sites/default/files exists but is not writable and could not be made writable." I've experimented with 777 permissions to no avail. Any thoughts?
Change ownership of the files directory to apache, or whatever your web user is.
chown -R apache.apache files
If you don't have access to change ownership for some reason, then making all files recursively writable should work.
chmod -R a+w files

Resources