|
It's not possible to give a complete answer to this question here. I would suggest you find a copy of the Linux source (it's open source so free) and read through the code. Alternatively I expect there are many books describing how Linux works, try a Google search for some possibilities.
It's time for a new signature.
|
|
|
|
|
|
Hi friends,
I've moved the apps into the Linux server under a driectory (/home/webdev/apps), which file i need to look to find out the current URL i should use to make the application work in browse?
Do I have to check any configure under /etc or something else? Please help, I am lost now..many thanks..
(to make the question simple, i have moved my application into a folder created under my username, i need to know the exact URL mapping to this folder, how can I achieve that info.?)
|
|
|
|
|
Create a directory called public_html in your home directory, then move the application directory inside public_html . Make sure all directories have "execute" permission for all users. The URL will be http://your.machinename.here/~webdev/apps
|
|
|
|
|
|
Hi Guys,
I need to deploy a PHP application in a Linux server, can anyone walk me through the basic steps? Many thanks.
Situation:
1) I have a login and pwd(i tried sudo su -, but seems i don't have pwd for that).
2) I need to install PEAR and extensions for my application.
3) I need to configure my application to make it work.
Currently I don't know where to start, can anyone show me a roadmap?
Thanks
|
|
|
|
|
I checked the php info page and found below information:
include_path .:/usr/share/pear .:/usr/share/pear
am I (or someone else) supposed to install package/extension into that directory?? I checked the directory :/usr/share and found there is no pear subdirectory.
please help..thanks..
|
|
|
|
|
alexyxj wrote: 1) I have a login and pwd(i tried sudo su -, but seems i don't have pwd for that).
Then you don't have the necessary rights to install the software. Ask the system administrator to install it for you.
|
|
|
|
|
is there any way to check if the extensions have been installed? do you know normally whcih directory is for those package and extensions? Thanks..
I have below directories in my root:
ApacheWWW boot etc home lib64 media mnt net oraoem root selinux sys tmp var
bin dev export lib lost+found misc MySqlDB opt proc sbin srv tftpboot usr
please advise.
|
|
|
|
|
alexyxj wrote: is there any way to check if the extensions have been installed?
Maybe, but it depends on the Linux distribution you are using. If the software has been installed from sources bypassing the distro's package management then you need to ask your system administrator or scan your machine with find or locate for the related files.
|
|
|
|
|
Hi there,
I have a piece of code to search through a multidimensional array and return the keys of successful hits...
The problem is that I can see it has checked all though the array (the echo "@"; shows an @ for each element of the array) but the matches are not returned, the array contains at least 30 "status" fields.
Can anyone tell me where I'm going wrong..
Thanks
Here is the code:
$haystack = $server1 = $tx->extractTable();
$needle = 'Status';
$index = null;
$aIt = new RecursiveArrayIterator($haystack);
$it = new RecursiveIteratorIterator($aIt);
while($it->valid())
{
if (((isset($index) AND ($it->key() == $index)) OR (!isset($index))) AND ($it->current() == $needle)) {
return $aIt->key();
echo $aIt->key();
}
echo "@";
$it->next();
}
return false;
|
|
|
|
|
nhsal69 wrote:
return $aIt->key();
echo $aIt->key();
Is there any reason why you are returning and then outputing? The output code (echo) is unreachable.
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Nope I just wanted to see what if anything was getting returned.. but it appears not.
|
|
|
|
|
Then there would appear to be something wrong with your logic.
nhsal69 wrote:
if (((isset($index) AND ($it->key() == $index)) OR (!isset($index))) AND ($it->current() == $needle))
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Ok, I've been staring at that for ages and my logic has vanished...
I re wrote it to this the below....
Only problem is that I still don't get a valid response..
the array is of the form :
[1] => Array ( [Name ] => Aberdeen [Status ] => Ready [Location ] => [Jobs ] => 0 [Model ] => HPUniversalPrintingPCL6 [Comment ] => PRINT_EARL
The correct number of "@" are retuned so it's performing the correct number of itterations, but no giving me the results...
I should have mentioned that I'm completely new to PHP and am kinda winging it....
Start of code chunk
$it = new RecursiveIteratorIterator( new RecursiveArrayIterator($server1));
echo "<table border='1'>";
foreach ($it as $key=>$val)
{
echo "@";
if ($val == "PRINT_EARL")
{
echo "<tr>";
echo "<td>";
echo $key;
echo "</td>";
echo "<td>";
echo $val;
echo "</td>";
echo "</tr>";
}
Else
echo $key.":".$val."\n";
}
End of code chunk
-- Modified Monday, May 3, 2010 10:51 AM
|
|
|
|
|
hi
i have written code in php to open a pdf file in browser
echo "<a href="pdf/abc.pdf">pdf</a>";
its not open pdf only start download file and after that i can open that file but i want to show this file on my browser while there is no iframe or other content please help me to show not download direct when i try to down load than download.
please suggest code for me
|
|
|
|
|
Google is your friend. Search for 'content-disposition header'. That's what tells the browser how to treat the pdf (or at least suggests). There is a php function to write the header.
|
|
|
|
|
Following code will be helpful to open pdf file.
<?php
// when form submitted, redirect to PDF file
if($file=="dick.pdf" || $file=="andrea.pdf" || $file=="lewis.pdf")
{
header("Location: $file");
exit();
}
// and else just display the thing
?>
<html>
<head>
<title>Download a PDF file</title>
</head>
<body>
<form action="thisfile.php" method="get">
<fieldset>
<legend>Please select a PDF file to download</legend>
<select name="file" size="1">
<option value="dick.pdf">Dick</option>
<option value="andrea.pdf">Andrea</option>
<option value="lewis.pdf">Lewis</option>
</select>
<input type="submit" value="Download!">
</form>
</body>
</html>
Hope this will help!
Jinal Desai
|
|
|
|
|
I don't know if it was you who 1-voted my reply, but I was at least answering the question the OP asked. He showed that he can write php to serve the pdf file. What he wants to do is to get the browser to display the file rather than offer a download. The way to do this is through the content-disposition header as I indicated.
|
|
|
|
|
Never mind my friend.
I am not here to vote anyone, I am just replying on what I know.
Jinal Desai - LIVE
|
|
|
|
|
PDF required adobe or post script plugin, close your browser and install adobe reader or some plugin that have pdf support for your browser., The second choice better you write book renderer like google books, this require ajax to load images that you created before , OR you can hunt library that can display pdf on the fly... REGARD!!!!
|
|
|
|
|
Friends , I have a code which uses Depreciated functions:
I have Marked that code BOLD, please help me if you could provide alternative statements to them ... like through PREG..
Please Help..
if (ereg("HTTP/[0-9.]+ (([0-9])[0-9]{2})", $answer, $regs)) {
$httpcode = $regs[2];
full_httpcode = $regs[1];
if ($httpcode <> 2 && $httpcode <> 3) {
$status['state'] = "Unreachable: http $full_httpcode";
$linkstate = "Unreachable";
}
}
if (ereg("Location: *([^\n\r ]+)", $answer, $regs) && $httpcode == 3 && $full_httpcode != 302) {
$status['path'] = $regs[1];
$status['state'] = "Relocation: http $full_httpcode";
fclose($fp);
return $status;
}
if (eregi("Last-Modified: *([a-z0-9,: ]+)", $answer, $regs)) {
$status['date'] = $regs[1];
}
if (eregi("Content-Type:", $answer)) {
$content = $answer;
$answer = '';
break;
}
if (eregi("Content-Type: *([a-z/.-]*)", $content, $regs)) {
if ($regs[1] == 'text/html' || $regs[1] == 'text/' || $regs[1] == 'text/plain') {
$status['content'] = 'text';
$status['state'] = 'ok';
} else if ($regs[1] == 'application/pdf' && $index_pdf == 1) {
$status['content'] = 'pdf';
$status['state'] = 'ok';
} else if (($regs[1] == 'application/msword' || $regs[1] == 'application/vnd.ms-word') && $index_doc == 1) {
$status['content'] = 'doc';
$status['state'] = 'ok';
} else if (($regs[1] == 'application/excel' || $regs[1] == 'application/vnd.ms-excel') && $index_xls == 1) {
$status['content'] = 'xls';
$status['state'] = 'ok';
} else if (($regs[1] == 'application/mspowerpoint' || $regs[1] == 'application/vnd.ms-powerpoint') && $index_ppt == 1) {
$status['content'] = 'ppt';
$status['state'] = 'ok';
} else {
$status['state'] = "Not text or html";
}
Please HELP me soon ..please REPLY!!!
|
|
|
|
|
is Google not working where you are? it gave me many links including this one[^].
|
|
|
|
|
Well friend i am googling from 5 days.
And i have found many links and studied them too.
and these BOLD queries that i have mentioned
are not being able to be resolved by me..
Actually i have to look for alternative for these
expression!!!
Hope u can help....with some solution or with a link which could
guide me how to resolve them!!
Its a new change by PHP and I can't catch it so soon..
So please help me
Or you can do another thing...
I am using XAMPP with php 5.3
is there any way to stop displaying those deprecated errors
|
|
|
|
|
I use XAMPP myself, however I don't want to hide error or warning messsages, I work on my code to avoid them in the first place.
From the link I provided it seems the new ereg and the old preg stuff is very similar; so I suggest you study where they differ and fix things in your code. Start with the very first occurence and fix that. From then on, it should be easy.
|
|
|
|