Uploading HTML Files to Display on Openshift PHP 5.4 Website? - php

I can't get these html files to display AS my Openshift site. Only the default Openshift created index.php file shows up (which I have edited; see "Test Test Test" as h1). How do I get MY html files to appear as the HOME page, etc. when I click on my http:/php-....rhcloud.com/ domain name?

It seems that you would like to replace the default index.php, which comes with the PHP 5.4 cartridge, with your own static Index.html page. To do that, simply:
delete the index.php from the repo
rename the Index.html to index.html (so it now starts with a lowercase i)
git add, git commit and git push both changes
...and your index.html will be rendered by the server instead as the index page when you visit your domain.

Related

Deploy Laravel in var/www/html

I have the following file structure on my server
/var/laravelapp -> this is the entire laravel project.
/var/www/html/eduapp - > this is the public_html folder which has a folder called eduapp with the public contents of laravelapp.
The login register and home page work
https://example.com/eduapp/
when i click on the other buttons in the homepage the url becomes https://example.com/routename therefore giving an error
if we manually add eduapp in the link eg. https://example.com/eduapp/routename it works!!
any suggestions or solutions?
so these are the things that made the app work
Changed APP_URL to example.com/eduapp.
Changed back button hrefs to href='../routename'.
Created Symlinks for public/img and storage folders.
Removed Slash from href routes.

where to put the copied live wordpress site in the local (unable to replicate site in localhost)?

I am new to wordpress, I have to copy a live website to localhost htdocs.I have copied whatever files hosted in TFS VCS and pasted into htdocs folder. Changed wp_ options like site_url and other configs to my localhost.Dumped database from that website into my local mysql and can see it in phpmyadmin. However, when navigate to the localhost directory in this case "localhost/test/src/index.php" it is saying undefined function "get_header()" in index.php.
My question is should I install wordpress locally and copy paste this source into that wordpress installed folder.
This sounds to me like you are trying to access theme's index.php directly.
Check this article or this one about WordPress File & Directory structure.
Update 1:
You mention in the comments that WordPress installation is present inside "htdocs/wordpress" folder. So what is inside "htdocs/test"?
Update 2:
If the "htdocs/test" contains folders like "plugins", "themes", "uploads", then you need to copy the content of "htdocs/test" inside "htdocs/wordpress/wp-content".
And to check if the website work, you go to htdocs/wordpress/.

NetBeans IDE and project setup

I set-up three projects in NetBeans IDE, two are html projects and another one is php project.
When I test run, the project php's index.php (Main home page) is wanted to be loaded first. Then it will load another index.html files (two sub pages).
But now when I run, the first html project's index.html is always loaded first since it is at the first position at IDE because of alphabetical order in project name.
How can I load php project's index.php file?
Whenever you create project on NetBeans, you can specify the URL of project in the "Project URL" field.
Please see the below screenshots that will help you.
Screenshot : Here you can see "Project URL" field, with the help of this you can specify you project's index.php file

Previewing a slim framework project with PhpStorm7 results page not found while

I am trying out the trial version of phpStorm 7 with php 5.5.5
When I preview the project in phpStorm ( go to index.php and click on a browser icon in top ), it opens
http://localhost:63342/project/index.php
And I get the default 404 page from Slim Framework. The Visit Home Page targets http://localhost:63342/index.php/ Which results in a 404 phpstorm page.
If I open bash go to PhpstormProjects/project/ and start the native php server php -S localhost:80 and I goto localhost in browser. The project works perfectly as it should.
I would like to be able to use phpstorms preview function instead of having to manual start the native server.
Project overview.
Started empty project, init composer, added `"slim/slim":"2.*" and installed. Added added index.php
Structure
// scroll down for content...
~/PhpstormProjects/project/index.php
// location of slim
~/PhpstormProjects/project/vendor/slim/slim ...
The content of index.php
<?php
error_reporting(E_ALL);
// include composer autoload
require_once('vendor/autoload.php');
$App = new Slim\Slim;
$App->get('/', function() {
echo 'Hello SO';
});
$App->run();
PhpStorm's built-in web server HAS to be accessed via http://localhost:63342/PROJECT_NAME/rest/of/the/path/file.php sort of URL. This is how URL builds automatically.
The key element here is PROJECT_NAME part -- this is how built-in web server detects what project you are working with (comparing to standard web server where such decision will be made based on domain name).
As I understand Slim framework simply cannot handle such URL with extra part in URL (at very least in default configuration), which is expected and understandable.
The bypass such restriction, you have to make few simple manual changes/configurations and you will be able to access your project via http://PROJECT_NAME:63342/rest/of/the/path/file.php URL
Let's assume that project name is slim1.
1. In your hosts file (or local DNS server, if you have one), create an entry that will point slim1 to localhost, e.g. 127.0.0.1 slim1
2. In PhpStorm -- create new Deployment entry (Settings | Deployment) of "In Place" type. Mark it as Default for this project and perform some very basic (and minimal) configuration (like, enter URL you want to use), e.g:
3. Now, when you use Preview file in... or Open in Browser actions on index.php, it will open http://slim1:63342/index.php instead of original http://localhost:63342/slim1/index.php.
P.S.
This applicable to any framework not just Slim.

How to configure internal url's content on Symfony

I am new to Symfony and I am trying to understand how a Symfony project works. Right now I am trying to change the content of an internal url. For example, in the layout.php file, I can put a sentence like:
Suecia
This works fine, when I press 'Suecia' "Button" it changes the content, and it adds viajesDeusto/new to the url. My question is, where can I change the content that the "viajesDeusto/new' url displays?
Thanks a lot
If you split the url in your url_for() function it breaks out to MODULE/ACTION
So go into your app (%SF_ROOT_DIR%/apps/%APP_NAME%)
inside that folder you have a modules folder
inside that you have the module name
inside that you have an actions folder and a templates folder
the actions folder is where your code to retrieve/process data resides
the templates folder is where the presentation code resides
For instance, if your app is called frontend the location of the code is:
%SF_ROOT_DIR%/apps/frontend/modules/viajesDeusto/actions
%SF_ROOT_DIR%/apps/frontend/modules/viajesDeusto/templates
This is the standard setup for syfony 1.x apps

Categories