xampp directly open my html file - xampp

I created folder called en407 and inside it i create a file called assigment that contain html , css and also php.
http://localhost/en407b/
When i click on the assginmnt file , i should let me choose what file to open
http://localhost/en407b/assignment
but the link directly go to my html file which is index.html and the link remains
http://localhost/en407b/assignment
in my assignment file , it contain index.html , index2.html and other....
how to fix it???

At first you can't run PHP in .html files because the server does not recognize it as valid till you tell it to do it. To do this create a .htaccess file in your root web directory and add this line inside it:
AddType application/x-httpd-php .htm .html
This will tell Apache to process files with a .htm or .html file extension as PHP files.

Related

sphinx documentation - excluding rst files that begin with a specific character?

I work on page drafts in my sphinx doc that I don't want to be available when I run sphinx-build.
for example I have files named _bob.md , _mistbuddy.md etc.
in my conf.py file I put:
exclude_patterns = [ '**/_*']
to ignore these file.
This works on load - files ignored :
However, if I then click on one of the topics, and ALL pages are available.
I have tried .. only:: <tag> however, a directive doesn't work on all contents in a file.
Thank you.

How to disable localhost/dashboard directory listing in xampp

Whenever I open localhost it redirects to this directory listing. Previously it used to show the index.html page "Welcome to XAMPP" now it shows directory listing. How do I revert it?
For whatever reason if xampp stops recognizing the dashboard index.html file simply edit xampp/htdocs/index.php file and edit the following line and add /index.html at the end of the line.
header('Location: '.$uri.'/dashboard/index.html');
This will make sure that the index.html is loaded rather than displaying the Directory listing.

Fail to Download File Using Jmeter

http://blazemeter.com/blog/how-performance-test-upload-and-download-scenarios-apache-jmeter
I've used above link for reference.
I'm Using Save Responses to a file with Download call.
But fail to Download file.
Can anyone tell me What Exactly i need Specify in
FileName Prefix:
Variable name :
and where to Specify download location ?
Provide absolute file path with a file name.
FileName Prefix: c:\workspace\jmeter-download\myfile
For ex: If your test is downloading a pdf file, you would see a 'myfile.pdf' under 'c:\workspace\jmeter-download'
I've used path like D:/xyzFolder/filename as Filename Prifix
it's working fine for me
and if any one wants file to download in same Dir in which your jmx file is
then just need to use ~/pre as Filename Prifix

how to change web server folder location in xampp

I have installed xampp and by default my website files are stored in htdocs. How do I change the webdirectory path?
Edit the file /opt/lampp/etc/httpd.conf and change the lines containing current web directory path. It should start with DocumentRoot. Update all the places having the current path to the path you would like it to be.
It can be done by editing the "httpd.conf" file present in this path "\xampp\apache\conf\".
Change the line that starts with "Directory ...".
Note that all the lines that start with a hash (#) are just comments and are there just to describe the commands present there in the file.
search for the file "httpd.conf" and change the path in that file.
change localhost's name ? thus instead of having localhostdomain/webdirectory
you may have newdomain/webdirectory ?

How to automatically find files of a specified type in the current directory or any specified sub-folders in Ruby?

I am using the following code to convert files from php to html. In order for it to work, I have to enter the name of each file on the second line.
p "convert files"
%w(file1 file2 file3).each do |name|
system %(php #{DIR}/#{name}.php > #{DIR2}/#{name}.htm)
end
Can someone tell me how to make it so it will automatically find any .php files in the main directory and look in any defined folder and their sub-folders for additional .php and save them in similar folder names?
For example:
file1.php -> file1.htm
about-us/file2.php -> about-us/file2.htm
contact-us/department/file3.php -> contact-us/department/file3.htm
The easiest way is to use Dir:
Dir.chdir('where_the_php_files_area')
Dir['**/*.php'].each do |php|
htm = 'where_the_html_files_should_go/' + php.sub(/\.php$/, '.htm')
system("php #{php} > #{htm}")
end
The ** pattern for Dir.glob (AKA Dir[]) matches directories recursively so Dir[**/*.php] will give you all the PHP files under the current directory.

Resources