I've inherited an application written using the Yii PHP framework. I've uploaded all the project files to a remote server, but I don't have SSH access or shell-exec permission.
Is it possible to make the application work in these circumstances?
If so, what files do I need to edit and in what way please?
Yes, it should be portable, all you need is just copy all project contents (including dependencies) to the destination folder and make proper configuration for a web-server.
The only one issue here is #app/runtime and #app/web/assets folders -- the should be accessible to write for web-process (the second is only if you are using AssetManager).
You can solve this issue in config, using runtimePath and assetManager['basePath'] parameters.
Related
I run a Symfony 4 application using the PHP built-in web server on my development environment.
I would like the /tmp folder on my host to be ignored from the Symfony routing process in order to be accessed directly (and so being able to access the files within this directory).
However, when requesting http://localhost:8000/tmp, Symfony tries to match the route /tmp, which obviously does not exist. Instead I would like to get a list of the /tmp folder files.
I guess there is no way to handle that simply using the PHP built-in webserver and I have no other choice than using a full-featured web server, but I just want to be sure that I'm not missing any option that could actually do that just using the built-in web server ?
Do not add your tmp folder in /public directory. If you want to use some temporary data better to hold them in /var directory and access to this folder in your controllers or services by using Finder component
I am working on a moodle based project, which I inherited from someone else. Having copied the files into htdocs folder and started MAMP, the files still don't show in the browser. Instead, the browser automatically initiates a download. I might be required to change the config file, however, since I do not have much experience with php and SQL I am not sure what exactly. My part of the project is to develop html and css, but need to be able to run it locally first.
What do I need to do to get the files run locally? The route I use is localhost:8888/whatever/whatever/index.php
In case someone else runs into the same problem - Apache downloads php files instead of reading them - here is what helped me.
.htaccess file may need changes if the application has changed servers.
Delete (at least rename if you don't want to remove it) config.php and run the application through the browser. It should initiate install automatically.
To run php and SQL I used MAMP.
When deploying a web application in PHP, one doesn't always want your configuration files with passwords to be committed into the repository.
What is the preferred method of handling this, ie.
saving the details in a DB, and templating the config file
copying the file onto the server (which raises the question of where to save
and version the file being copied in)
setting the environment variables on the server, and having the config file reading from
that.
or any other suggestions.
You can have your config files in a folder out of the public folder and restrict the access to that folder using .htaccess file. Of course this works if you are using Apache as webserver.
I am trying to deploy a Lithium app on Heroku, but Heroku uses a read-only file system for apps. This causes a problem with the app/resources folder. I've tried looking for a setting the lithium config to change the path to this folder, but it appears to be hard coded.
Can anyone recommend how to resolve this issue?
Lithium uses the /resources folder for writing temporary files such as logs, file caches, compiled PHP templates, etc.
The path is configurable through Libraries::add() when the application is initialized. In config/bootstrap/libraries.php, you can replace your application's Libraries::add() call with one like the following: https://github.com/orchestra-io/sample-lithium/blob/master/app/config/bootstrap/orchestra.php#L10
This configuration uses the system's temp directory, and checks for/initializes the subdirectories Lithium will use.
I'm not sure if I'm missing the point here...
Our devs want the following...
On a LAMP server with SVN/WebDAV they want the root Apache directory to be a repository that they can all work on. However, setting the default Apache directory to a repo doesn't work as the files aren't stored as html/php files, instead in the SVN db structure to handle changes/revisions/etc.
Is there any way to do this? or would we have to have a separate repo that they copy files to/from the web root when developing?
You have to setup a separate svn repository and Hook Scripts. This hook scripts can checkout the code on every code change to your apache root. This is quite common an also used for automatic testing etc.