Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I recently started working in a company and one of the first tasks that I was given was to redo their website.
Being a newbie and after a few trial and errors on sites like wix.com, weebly.com, I made a WordPress website with a responsive theme using a WAMP server.
The site seems all fine but when the time came to finally put it on the server, I came to know that the hosting company only supports HTML based website whereas the website I built is a PHP one. The following are my questions
How do I go about publishing my WordPress site on an HTML supported only server? Is there a way to convert the website or any other method? If yes, please explain in detail as I am a newbie.
I was somehow able to export my database from the localhost MySQL server to that of the server where I want my site to be but does the web hosting company only supporting HTML based website affect the database in MySQL server? If yes, what should be done and how? Kindly explain in detail.
The cPanel of the webhost is pretty basic and on calling the company, I was told that all I had to do was drag and drop my files there for my site to go online but that dint work.
I tried changing the extensions from PHP to HTML and uploading the files, but all I get is a blank screen on going on going to www.mycompanydomain.ae.
I even tried the whole adding a line in the .htaccess file to open as an HTML without actually changing the all the PHP files but to no avail.
Kindly help as I have spent a lot of time and energy on this but now I am at a roadblock.
You could browse through each page that makes up your website and use your browser to "save" a local copy of the page and upload these. A an easier way to accomplish this foolish task would be to use a web crawling tool like WebReaper on your local website and upload the results to the HTML only host.
The caveats to doing this are:
Your site is no longer interactive, everything is static.
Nice folder structure goes out the window and everything is a mess
It's obviously a bad idea
Don't do this, it's a bad idea
No, seriously.
The correct solution, if you need to have anything server-side/database interactive, is switch to a host that has PHP enabled. You would also want to use a tool like PHPMyAdmin to export your local database and import it on the new host.
You can't do it in HTML. But you can use iframe and wordpress.com or host it elsewhere...
The plugin Really Static/ claims to generate HTML files each time you update your WordPress blog: "saving static files via local, FTP, SFTP" and "
if you don't have PHP/MySQL support on your server you can host your WordPress installation locally and use a normal HTML webspace for publishing"
I hope this helps!
No, there's no practical way to transform your entire site into HTML.
Switch to a web host that supports PHP.
Related
I am new to the web app development and server topics so my question is rather theoretical. I’ve searched and went through a lot of related topics but haven’t found any satisfying answer and explanation:
Lately I was trying to write a rather simple PHP/html web app to display the content of my local dir let’s say C:/Users/Desktop and generate hyperlinks that would redirect me to the subfolders (and ideally open files in it)
I tried a lot of ready solutions but they were very outdated (3 or 4 years ago) then I found out that it is impossible on all web browsers because of security reasons. From what I learned it is only possible when browsing files on a server but I don’t really know how to enable it locally on my PC.
Could anyone explain to me why it is so? Or if it’s any way to pass it?
Thanks in advance, best regards.
You can easily install a local server (including php runtime) on your PC, like https://www.apachefriends.org or http://www.wampserver.com
A simple guide: https://blog.udemy.com/xampp-tutorial/
List files: List all files in one directory PHP
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have a management system built in PHP that will run locally on multiple computers. I want to hide the source code from the user of the system. I do not want to share the code but only the application.
The user can view the application, use it and can also make changes but I don't want the user to get access to the PHP files or any other project files as they are placed in htdocs (Xampp) and www (wamp) folder.
I have searched so far and I couldn't find out but only some decoders:
ionCube
Zend Guard
PHP Obfuscator
I would suggest mounting this on a local webserver instead and asking the users to access this over a network connection in thier browser rather than directly from localhost. This way, the code will be isolated on the webserver, and as long as you don't "share" the root folder on the network, they won't be able to see the source files in any way.
If you must encrypt the code, then you've already seen the 2 most popular ways of encoding. Xampp can be configured to use IonCube and ZendGuard. Just ensure that you encode it in a way that can be decoded on the client machine (you can encode to differing PHP versions)
As #Edmondscommerce stated, I think the most viable option is to host it externally. This could be in a local network so that you don't have to host it online. There are many disadvantages to run and store your files locally (each client will have to run a webserver, updates will be disastrous and you, rightly so, have security concerns).
That said, if it has to run locally, there are still some ways to hide the contents of the files depending on the user(s) of the system. If the user is not an admin and you do have those rights, you could set the the server files to inaccessible using the local OS' methods (I.e. revoke read and write rights). Be sure that the webserver will have to be given at least read access to the files in order to serve them to the local user.
you can put your source code in some where hidden in the host and change the server root path form "C:\xampp\htdocs" to your new one.
This question already has answers here:
Access php files through a link on the web
(3 answers)
Closed 8 years ago.
Okay here's the scenario:
Suppose I'm already done designing and coding a website (in PHP, HTML, CSS and other stuffs that help create a website functional) which is still sitting on my desktop, the question is "What's next? How do I publish it to the web?"
Please help, I've seen some tutorials but couldn't understand them.
Well, once you got your website, next step is to find a hosting to place it.
Take in mind, if you are going to "free hosting", some of them don't allow PHP files.
Once you got it, I'll reccomend you a FTP client, such FileZilla or similars, to upload your content to the hosting. Make sure, of course you got a page called index.php/index.html, so it will be loaded when you type in your website.
You need to learn about How to do web hosting
And so many things like
Domain registration
Webserver
and so many.You can have a good and simple tutorial for a beginner in the reference link.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I just discovered that every website in my hosting account (which is a shared hosting) is infected with malicious code.
The malicious code is a < script> tag appended after the < /html> tag. It redirects to a russian website.
The problem is this: my PHP files are not compromissed. I downloaded them via FTP, and they are fine. The "last modified" dates are fine too (some files are from 2012). Even if I upload a brand new PHP file, when I access it through the web, it's infected. But if I download it again via FTP, it´s fine.
It's like some .htaccess rule is appending the malicious code to all my PHP pages AFTER they pass through the PHP engine, or something like that (but my .htaccess files are fine too).
What could be the problem? Is the hosting provider compromised, or is it my account? What can I do to solve this problem? Google is already sending me malware notifications, and the support guys are slow as hell.
Thanks for your time, and please forgive my poor english.
Edit: Adding < ?php exit() ?> to the end of any PHP file stops the infection, so this seems to be a PHP problem.
Yeah, wouldn't hurt to change your ftp password, also look for files that aren't yours or part of the installation. I've had issue like that before and there were scripts in the images directory that I didn't put there. I removed them. Change any files so that they aren't world writeable. e.g. change from 666 to 644. Do the same to directories, 777 to 755. If the files and directories are owned by the ftp user the lesser permissions should be fine.
Then maybe try this to clean up or get your host to do it if you don't have access.
http://cachecrew.com/fixing-an-infected-php-web-server/
The first thing I would do, is change the FTP password, and run an anti-virus on the computer you are using to access the FTP.
Something like this has happened to me before, and the point of intrusion on the web server was trough the stealing of the FTP user and password trough a trojan.
About the PHP files, and in the start of the file, aren't their any strange tag?
In my case, the files were updated on the start on the file, and it wasn't only PHP files, HTML files were also affected.
The script tag that appear after the tag, could be inserted their trough Javascript. And don't rely on the date modified ( check this answer )
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I've always debated this in my head and now would like some input from you guys at stack. So what is faster?
I can see that grabbing images from files are probably the fastest since it's local, but the process of finding the files through folders and picking the right one would probably use up the most processing power.
Grabbing a image from url could simply be sending a request to the url and downloading that image. While the image is downloading, other parts of your website is loading.
When loading a page, how does the server run one (or few) processing threads to build the page? Does a page get built in a procedural fashion (building one thing at a time as apposed to running everything at the same time)? Could this be the difference of procedural PHP (Wordpress) and object oriented PHP (Codeigniter)?
When you get file via url you need to connect to server. Now you have two cases:
Server is local
Server is external
If server is local then you may use local IP which won't cause DNS to resolve adress and it's pretty fast but server is involved.
If the server is extarnal then you need to use either domain or ip if you know it. You need to calculate the speed of connection and speed of server but in my personal opinion this is not good solution.
About using files. You wrote that you have URL which exactly defines where the file is. You can do the same with files and give the path so there's no need to find the file just to download it. I'm certain it's faster solution.
About Wordpress and Codeigniter it's still PHP so it depends how the code is used. Obviosly you can write stupid function that looks in entire server to find a file or you can specify where it should be or you can give a path to it. So it's faster. There are also nice solutions in PHP to search for files and handle them. For example iterators or simple glob() function.
To conclude, my opinion is that using files instead urls is better solution.
The way it works is,
a) The HTML document (static / the one emitted from PHP) gets downloaded from the server to the browser.
b) The browser will start parsing it.
c) It parses each and every tag and renders / controls(i.e., JavaScript) accordingly.
If there are any resources that needs to be loaded, browser makes an additional request to download that resource.
Any request that is sent over the network, there would be a delay.
There are ways how you could optimize it. Few such tips are given below that includes reducing DNS look up too.
http://developer.yahoo.com/performance/rules.html
It is always better to use CSS Image Sprites, HTML5 local storage if the files are not getting changed very often.